Showing preview only (4,201K chars total). Download the full file or copy to clipboard to get everything.
Repository: Peterkn2001/blynk-server
Branch: master
Commit: 39c6b17d8dfb
Files: 782
Total size: 3.8 MB
Directory structure:
gitextract_bg4_g3iy/
├── .gitignore
├── .travis.yml
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── README.md
├── apiary.apib
├── checkstyle.xml
├── client/
│ ├── README.md
│ ├── pom.xml
│ └── src/
│ ├── main/
│ │ ├── java/
│ │ │ └── cc/
│ │ │ └── blynk/
│ │ │ └── client/
│ │ │ ├── ClientLauncher.java
│ │ │ ├── CommandParserUtil.java
│ │ │ ├── core/
│ │ │ │ ├── ActiveHardwareClient.java
│ │ │ │ ├── AppClient.java
│ │ │ │ ├── BaseClient.java
│ │ │ │ └── HardwareClient.java
│ │ │ ├── enums/
│ │ │ │ └── ClientMode.java
│ │ │ └── handlers/
│ │ │ ├── ClientReplayingMessageDecoder.java
│ │ │ ├── decoders/
│ │ │ │ ├── AppClientMessageDecoder.java
│ │ │ │ └── ClientMessageDecoder.java
│ │ │ └── hardware/
│ │ │ └── HardwareEchoHandler.java
│ │ └── resources/
│ │ ├── log4j2.xml
│ │ └── test.crt
│ └── test/
│ └── java/
│ └── cc/
│ └── blynk/
│ └── client/
│ └── ClientTest.java
├── docs/
│ ├── README_FOR_APP_DEVS.md
│ └── websocket/
│ ├── Command.js
│ ├── README.MD
│ └── websocket.js.html
├── integration-tests/
│ ├── pom.xml
│ └── src/
│ └── test/
│ ├── java/
│ │ └── cc/
│ │ └── blynk/
│ │ └── integration/
│ │ ├── BaseTest.java
│ │ ├── CounterBase.java
│ │ ├── MyHostVerifier.java
│ │ ├── SingleServerInstancePerTest.java
│ │ ├── SingleServerInstancePerTestWithDB.java
│ │ ├── TestUtil.java
│ │ ├── http/
│ │ │ ├── AcmeTest.java
│ │ │ ├── HttpAPIKeepAliveServerTest.java
│ │ │ ├── HttpAPIPinsAsyncClientTest.java
│ │ │ ├── HttpAPIPinsTest.java
│ │ │ ├── HttpAndTCPSameJVMTest.java
│ │ │ ├── OTATest.java
│ │ │ └── UploadAPITest.java
│ │ ├── https/
│ │ │ ├── HttpResetPassTest.java
│ │ │ └── HttpsAdminServerTest.java
│ │ ├── model/
│ │ │ ├── MockHolder.java
│ │ │ ├── SimpleClientHandler.java
│ │ │ ├── http/
│ │ │ │ ├── PinJsonResponse.java
│ │ │ │ └── ResponseUserEntity.java
│ │ │ ├── tcp/
│ │ │ │ ├── BaseTestAppClient.java
│ │ │ │ ├── BaseTestHardwareClient.java
│ │ │ │ ├── ClientPair.java
│ │ │ │ ├── TestAppClient.java
│ │ │ │ ├── TestHardClient.java
│ │ │ │ └── TestSslHardClient.java
│ │ │ └── websocket/
│ │ │ ├── AppWebSocketClient.java
│ │ │ ├── AppWebSocketClientHandler.java
│ │ │ ├── WebSocketClient.java
│ │ │ └── WebSocketClientHandler.java
│ │ ├── tcp/
│ │ │ ├── AppMailTest.java
│ │ │ ├── AppOfflineTest.java
│ │ │ ├── AppSyncWorkflowTest.java
│ │ │ ├── AppWorkflowTest.java
│ │ │ ├── AssignTokenTest.java
│ │ │ ├── BlynkInternalTest.java
│ │ │ ├── BridgeWorkflowTest.java
│ │ │ ├── CloneWorkFlowTest.java
│ │ │ ├── DeviceCommandsTest.java
│ │ │ ├── DeviceSelectorWorkflowTest.java
│ │ │ ├── DeviceTilesWidgetTest.java
│ │ │ ├── DeviceWorkflowTest.java
│ │ │ ├── EnergyWorkflowTest.java
│ │ │ ├── EventorTest.java
│ │ │ ├── FacebookLoginTest.java
│ │ │ ├── HistoryGraphTest.java
│ │ │ ├── LoadBalancingIntegrationTest.java
│ │ │ ├── MainWorkflowTest.java
│ │ │ ├── MultiAppTest.java
│ │ │ ├── NotificationsLogicTest.java
│ │ │ ├── OfflineNotificationTest.java
│ │ │ ├── PortUnificationTest.java
│ │ │ ├── PublishingPreviewFlow.java
│ │ │ ├── ReadingWorkflowTest.java
│ │ │ ├── RegistrationLimitCheckTest.java
│ │ │ ├── ReportingTest.java
│ │ │ ├── SetPropertyTest.java
│ │ │ ├── ShareProfileWorkflowTest.java
│ │ │ ├── SimplePerformanceTest.java
│ │ │ ├── SyncWorkflowTest.java
│ │ │ ├── TableCommandsTest.java
│ │ │ ├── TagCommandsTest.java
│ │ │ ├── TimerTest.java
│ │ │ ├── WebhookTest.java
│ │ │ └── WidgetWorkflowTest.java
│ │ ├── tools/
│ │ │ ├── FlahsedTokenGenerator.java
│ │ │ ├── ProjectTokenGenerator.java
│ │ │ ├── QRGenerator.java
│ │ │ ├── TokenGenerator.java
│ │ │ └── UserReader.java
│ │ └── websocket/
│ │ └── WebSocketTest.java
│ └── resources/
│ ├── db-test.properties
│ ├── json_test/
│ │ ├── user_profile_json.txt
│ │ ├── user_profile_json_2.txt
│ │ ├── user_profile_json_3_dashes.txt
│ │ ├── user_profile_json_empty_dash.txt
│ │ └── user_profile_json_many_dashes.txt
│ ├── log4j2-test.xml
│ ├── no_certs.properties
│ ├── profiles/
│ │ └── u_dmitriy@blynk.cc.user
│ ├── server.properties
│ ├── server2.properties
│ ├── test-certs/
│ │ └── mutual/
│ │ ├── app.crt
│ │ ├── app.pem
│ │ ├── server.crt
│ │ └── server.pem
│ └── twitter4j.properties
├── license.txt
├── new_server_install.md
├── pom.xml
├── scripts/
│ ├── copy_to_qa.sh
│ ├── db
│ ├── help_tools.sh
│ ├── move.bat
│ ├── move.sh
│ ├── native_openssl.sh
│ ├── ulimit
│ ├── userfull_commands
│ └── win/
│ ├── README.md
│ └── StartBlynkServer.cmd
└── server/
├── Docker/
│ ├── Dockerfile
│ ├── README.md
│ └── bin/
│ └── run.sh
├── acme/
│ ├── pom.xml
│ └── src/
│ └── main/
│ └── java/
│ ├── cc/
│ │ └── blynk/
│ │ └── server/
│ │ └── acme/
│ │ ├── AcmeClient.java
│ │ └── ContentHolder.java
│ └── module-info.java
├── core/
│ ├── pom.xml
│ └── src/
│ ├── main/
│ │ ├── java/
│ │ │ ├── cc/
│ │ │ │ └── blynk/
│ │ │ │ └── server/
│ │ │ │ ├── Holder.java
│ │ │ │ ├── Limits.java
│ │ │ │ ├── SslContextHolder.java
│ │ │ │ ├── TextHolder.java
│ │ │ │ ├── common/
│ │ │ │ │ ├── BaseSimpleChannelInboundHandler.java
│ │ │ │ │ └── handlers/
│ │ │ │ │ ├── AlreadyLoggedHandler.java
│ │ │ │ │ ├── UserNotLoggedHandler.java
│ │ │ │ │ └── logic/
│ │ │ │ │ └── PingLogic.java
│ │ │ │ ├── core/
│ │ │ │ │ ├── BlockingIOProcessor.java
│ │ │ │ │ ├── dao/
│ │ │ │ │ │ ├── CSVGenerator.java
│ │ │ │ │ │ ├── FileManager.java
│ │ │ │ │ │ ├── RegularTokenManager.java
│ │ │ │ │ │ ├── ReportingDiskDao.java
│ │ │ │ │ │ ├── SessionDao.java
│ │ │ │ │ │ ├── SharedTokenManager.java
│ │ │ │ │ │ ├── SharedTokenValue.java
│ │ │ │ │ │ ├── TemporaryTokenValue.java
│ │ │ │ │ │ ├── TokenManager.java
│ │ │ │ │ │ ├── TokenValue.java
│ │ │ │ │ │ ├── UserDao.java
│ │ │ │ │ │ ├── UserKey.java
│ │ │ │ │ │ ├── functions/
│ │ │ │ │ │ │ ├── AverageGraphFunction.java
│ │ │ │ │ │ │ ├── GraphFunction.java
│ │ │ │ │ │ │ ├── MaxGraphFunction.java
│ │ │ │ │ │ │ ├── MedianGraphFunction.java
│ │ │ │ │ │ │ ├── MinGraphFunction.java
│ │ │ │ │ │ │ └── SumGraphFunction.java
│ │ │ │ │ │ └── ota/
│ │ │ │ │ │ ├── OTAInfo.java
│ │ │ │ │ │ └── OTAManager.java
│ │ │ │ │ ├── model/
│ │ │ │ │ │ ├── DashBoard.java
│ │ │ │ │ │ ├── DashboardSettings.java
│ │ │ │ │ │ ├── DataStream.java
│ │ │ │ │ │ ├── Profile.java
│ │ │ │ │ │ ├── auth/
│ │ │ │ │ │ │ ├── App.java
│ │ │ │ │ │ │ ├── FacebookTokenResponse.java
│ │ │ │ │ │ │ ├── Session.java
│ │ │ │ │ │ │ └── User.java
│ │ │ │ │ │ ├── device/
│ │ │ │ │ │ │ ├── BoardType.java
│ │ │ │ │ │ │ ├── ConnectionType.java
│ │ │ │ │ │ │ ├── Device.java
│ │ │ │ │ │ │ ├── DeviceOtaInfo.java
│ │ │ │ │ │ │ ├── DeviceStatusDTO.java
│ │ │ │ │ │ │ ├── HardwareInfo.java
│ │ │ │ │ │ │ ├── HardwareInfoPrivate.java
│ │ │ │ │ │ │ ├── Status.java
│ │ │ │ │ │ │ └── Tag.java
│ │ │ │ │ │ ├── enums/
│ │ │ │ │ │ │ ├── PinMode.java
│ │ │ │ │ │ │ ├── PinType.java
│ │ │ │ │ │ │ ├── ProvisionType.java
│ │ │ │ │ │ │ ├── Theme.java
│ │ │ │ │ │ │ └── WidgetProperty.java
│ │ │ │ │ │ ├── graph/
│ │ │ │ │ │ │ └── GraphKey.java
│ │ │ │ │ │ ├── serialization/
│ │ │ │ │ │ │ ├── CopyUtil.java
│ │ │ │ │ │ │ ├── JsonParser.java
│ │ │ │ │ │ │ └── View.java
│ │ │ │ │ │ ├── storage/
│ │ │ │ │ │ │ ├── DashPinStorageKeyDeserializer.java
│ │ │ │ │ │ │ ├── PinStorageKeyDeserializer.java
│ │ │ │ │ │ │ ├── PinStorageValueDeserializer.java
│ │ │ │ │ │ │ ├── key/
│ │ │ │ │ │ │ │ ├── DashPinPropertyStorageKey.java
│ │ │ │ │ │ │ │ ├── DashPinStorageKey.java
│ │ │ │ │ │ │ │ ├── PinPropertyStorageKey.java
│ │ │ │ │ │ │ │ └── PinStorageKey.java
│ │ │ │ │ │ │ └── value/
│ │ │ │ │ │ │ ├── MultiPinStorageValue.java
│ │ │ │ │ │ │ ├── MultiPinStorageValueType.java
│ │ │ │ │ │ │ ├── PinStorageValue.java
│ │ │ │ │ │ │ └── SinglePinStorageValue.java
│ │ │ │ │ │ └── widgets/
│ │ │ │ │ │ ├── CopyObject.java
│ │ │ │ │ │ ├── DeviceCleaner.java
│ │ │ │ │ │ ├── FrequencyWidget.java
│ │ │ │ │ │ ├── HardwareSyncWidget.java
│ │ │ │ │ │ ├── MobileSyncWidget.java
│ │ │ │ │ │ ├── MultiPinWidget.java
│ │ │ │ │ │ ├── NoPinWidget.java
│ │ │ │ │ │ ├── OnePinReadingWidget.java
│ │ │ │ │ │ ├── OnePinWidget.java
│ │ │ │ │ │ ├── Target.java
│ │ │ │ │ │ ├── Widget.java
│ │ │ │ │ │ ├── controls/
│ │ │ │ │ │ │ ├── Button.java
│ │ │ │ │ │ │ ├── ButtonState.java
│ │ │ │ │ │ │ ├── ButtonStyle.java
│ │ │ │ │ │ │ ├── Edge.java
│ │ │ │ │ │ │ ├── LinkButton.java
│ │ │ │ │ │ │ ├── NumberInput.java
│ │ │ │ │ │ │ ├── QR.java
│ │ │ │ │ │ │ ├── RGB.java
│ │ │ │ │ │ │ ├── SegmentedControl.java
│ │ │ │ │ │ │ ├── Slider.java
│ │ │ │ │ │ │ ├── Step.java
│ │ │ │ │ │ │ ├── StyledButton.java
│ │ │ │ │ │ │ ├── Switch.java
│ │ │ │ │ │ │ ├── Terminal.java
│ │ │ │ │ │ │ ├── TextInput.java
│ │ │ │ │ │ │ ├── Timer.java
│ │ │ │ │ │ │ ├── TwoAxisJoystick.java
│ │ │ │ │ │ │ ├── VerticalSlider.java
│ │ │ │ │ │ │ └── VerticalStep.java
│ │ │ │ │ │ ├── notifications/
│ │ │ │ │ │ │ ├── Mail.java
│ │ │ │ │ │ │ ├── Notification.java
│ │ │ │ │ │ │ ├── SMS.java
│ │ │ │ │ │ │ └── Twitter.java
│ │ │ │ │ │ ├── others/
│ │ │ │ │ │ │ ├── Bluetooth.java
│ │ │ │ │ │ │ ├── BluetoothSerial.java
│ │ │ │ │ │ │ ├── Bridge.java
│ │ │ │ │ │ │ ├── Player.java
│ │ │ │ │ │ │ ├── TextWidget.java
│ │ │ │ │ │ │ ├── Video.java
│ │ │ │ │ │ │ ├── eventor/
│ │ │ │ │ │ │ │ ├── Eventor.java
│ │ │ │ │ │ │ │ ├── Rule.java
│ │ │ │ │ │ │ │ ├── TimerTime.java
│ │ │ │ │ │ │ │ └── model/
│ │ │ │ │ │ │ │ ├── action/
│ │ │ │ │ │ │ │ │ ├── BaseAction.java
│ │ │ │ │ │ │ │ │ ├── SetPinAction.java
│ │ │ │ │ │ │ │ │ ├── SetPinActionType.java
│ │ │ │ │ │ │ │ │ ├── SetPropertyPinAction.java
│ │ │ │ │ │ │ │ │ └── notification/
│ │ │ │ │ │ │ │ │ ├── MailAction.java
│ │ │ │ │ │ │ │ │ ├── NotificationAction.java
│ │ │ │ │ │ │ │ │ ├── NotifyAction.java
│ │ │ │ │ │ │ │ │ └── TwitAction.java
│ │ │ │ │ │ │ │ └── condition/
│ │ │ │ │ │ │ │ ├── BaseCondition.java
│ │ │ │ │ │ │ │ ├── ValueChanged.java
│ │ │ │ │ │ │ │ ├── number/
│ │ │ │ │ │ │ │ │ ├── Between.java
│ │ │ │ │ │ │ │ │ ├── Equal.java
│ │ │ │ │ │ │ │ │ ├── GreaterThan.java
│ │ │ │ │ │ │ │ │ ├── GreaterThanOrEqual.java
│ │ │ │ │ │ │ │ │ ├── LessThan.java
│ │ │ │ │ │ │ │ │ ├── LessThanOrEqual.java
│ │ │ │ │ │ │ │ │ ├── NotBetween.java
│ │ │ │ │ │ │ │ │ └── NotEqual.java
│ │ │ │ │ │ │ │ └── string/
│ │ │ │ │ │ │ │ ├── StringEqual.java
│ │ │ │ │ │ │ │ └── StringNotEqual.java
│ │ │ │ │ │ │ ├── rtc/
│ │ │ │ │ │ │ │ ├── RTC.java
│ │ │ │ │ │ │ │ ├── StringToZoneId.java
│ │ │ │ │ │ │ │ └── ZoneIdToString.java
│ │ │ │ │ │ │ └── webhook/
│ │ │ │ │ │ │ ├── Header.java
│ │ │ │ │ │ │ ├── SupportedWebhookMethod.java
│ │ │ │ │ │ │ └── WebHook.java
│ │ │ │ │ │ ├── outputs/
│ │ │ │ │ │ │ ├── Gauge.java
│ │ │ │ │ │ │ ├── LCD.java
│ │ │ │ │ │ │ ├── LED.java
│ │ │ │ │ │ │ ├── LabeledValueDisplay.java
│ │ │ │ │ │ │ ├── LevelDisplay.java
│ │ │ │ │ │ │ ├── Map.java
│ │ │ │ │ │ │ ├── TextAlignment.java
│ │ │ │ │ │ │ ├── ValueDisplay.java
│ │ │ │ │ │ │ ├── VerticalLevelDisplay.java
│ │ │ │ │ │ │ └── graph/
│ │ │ │ │ │ │ ├── AggregationFunctionType.java
│ │ │ │ │ │ │ ├── FontSize.java
│ │ │ │ │ │ │ ├── GoalLine.java
│ │ │ │ │ │ │ ├── GraphDataStream.java
│ │ │ │ │ │ │ ├── GraphGranularityType.java
│ │ │ │ │ │ │ ├── GraphPeriod.java
│ │ │ │ │ │ │ ├── GraphType.java
│ │ │ │ │ │ │ ├── LineType.java
│ │ │ │ │ │ │ ├── Stacking.java
│ │ │ │ │ │ │ ├── Superchart.java
│ │ │ │ │ │ │ └── YAxisScale.java
│ │ │ │ │ │ ├── sensors/
│ │ │ │ │ │ │ ├── Accelerometer.java
│ │ │ │ │ │ │ ├── Barometer.java
│ │ │ │ │ │ │ ├── GPSStreaming.java
│ │ │ │ │ │ │ ├── GPSTrigger.java
│ │ │ │ │ │ │ ├── Gravity.java
│ │ │ │ │ │ │ ├── Humidity.java
│ │ │ │ │ │ │ ├── Light.java
│ │ │ │ │ │ │ ├── Proximity.java
│ │ │ │ │ │ │ └── Temperature.java
│ │ │ │ │ │ └── ui/
│ │ │ │ │ │ ├── DeviceSelector.java
│ │ │ │ │ │ ├── Menu.java
│ │ │ │ │ │ ├── Tab.java
│ │ │ │ │ │ ├── Tabs.java
│ │ │ │ │ │ ├── TimeInput.java
│ │ │ │ │ │ ├── image/
│ │ │ │ │ │ │ ├── Image.java
│ │ │ │ │ │ │ ├── ImageScaling.java
│ │ │ │ │ │ │ └── ImageSource.java
│ │ │ │ │ │ ├── reporting/
│ │ │ │ │ │ │ ├── BaseReportTask.java
│ │ │ │ │ │ │ ├── Format.java
│ │ │ │ │ │ │ ├── PeriodicReportTask.java
│ │ │ │ │ │ │ ├── Report.java
│ │ │ │ │ │ │ ├── ReportOutput.java
│ │ │ │ │ │ │ ├── ReportResult.java
│ │ │ │ │ │ │ ├── ReportScheduler.java
│ │ │ │ │ │ │ ├── ReportTaskKey.java
│ │ │ │ │ │ │ ├── ReportingWidget.java
│ │ │ │ │ │ │ ├── source/
│ │ │ │ │ │ │ │ ├── DeviceReportSource.java
│ │ │ │ │ │ │ │ ├── ReportDataStream.java
│ │ │ │ │ │ │ │ ├── ReportSource.java
│ │ │ │ │ │ │ │ └── TileTemplateReportSource.java
│ │ │ │ │ │ │ └── type/
│ │ │ │ │ │ │ ├── BaseReportType.java
│ │ │ │ │ │ │ ├── DailyReport.java
│ │ │ │ │ │ │ ├── DayOfMonth.java
│ │ │ │ │ │ │ ├── MonthlyReport.java
│ │ │ │ │ │ │ ├── OneTimeReport.java
│ │ │ │ │ │ │ ├── ReportDurationType.java
│ │ │ │ │ │ │ └── WeeklyReport.java
│ │ │ │ │ │ ├── table/
│ │ │ │ │ │ │ ├── Column.java
│ │ │ │ │ │ │ ├── Row.java
│ │ │ │ │ │ │ └── Table.java
│ │ │ │ │ │ └── tiles/
│ │ │ │ │ │ ├── DeviceTiles.java
│ │ │ │ │ │ ├── SortType.java
│ │ │ │ │ │ ├── Tile.java
│ │ │ │ │ │ ├── TileMode.java
│ │ │ │ │ │ ├── TileTemplate.java
│ │ │ │ │ │ └── templates/
│ │ │ │ │ │ ├── ButtonTileTemplate.java
│ │ │ │ │ │ ├── DimmerTileTemplate.java
│ │ │ │ │ │ ├── Interaction.java
│ │ │ │ │ │ ├── PageTileTemplate.java
│ │ │ │ │ │ └── State.java
│ │ │ │ │ ├── processors/
│ │ │ │ │ │ ├── BaseProcessorHandler.java
│ │ │ │ │ │ ├── EventorProcessor.java
│ │ │ │ │ │ ├── NotificationBase.java
│ │ │ │ │ │ └── WebhookProcessor.java
│ │ │ │ │ ├── protocol/
│ │ │ │ │ │ ├── enums/
│ │ │ │ │ │ │ ├── Command.java
│ │ │ │ │ │ │ └── Response.java
│ │ │ │ │ │ ├── exceptions/
│ │ │ │ │ │ │ ├── BaseServerException.java
│ │ │ │ │ │ │ ├── IllegalCommandBodyException.java
│ │ │ │ │ │ │ ├── IllegalCommandException.java
│ │ │ │ │ │ │ ├── NoDataException.java
│ │ │ │ │ │ │ ├── NotAllowedException.java
│ │ │ │ │ │ │ ├── QuotaLimitException.java
│ │ │ │ │ │ │ └── UnsupportedCommandException.java
│ │ │ │ │ │ ├── handlers/
│ │ │ │ │ │ │ ├── DefaultExceptionHandler.java
│ │ │ │ │ │ │ ├── decoders/
│ │ │ │ │ │ │ │ ├── MessageDecoder.java
│ │ │ │ │ │ │ │ ├── MobileMessageDecoder.java
│ │ │ │ │ │ │ │ └── WSMessageDecoder.java
│ │ │ │ │ │ │ └── encoders/
│ │ │ │ │ │ │ ├── MessageEncoder.java
│ │ │ │ │ │ │ ├── MobileMessageEncoder.java
│ │ │ │ │ │ │ └── WSMessageEncoder.java
│ │ │ │ │ │ └── model/
│ │ │ │ │ │ └── messages/
│ │ │ │ │ │ ├── BinaryMessage.java
│ │ │ │ │ │ ├── MessageBase.java
│ │ │ │ │ │ ├── MessageFactory.java
│ │ │ │ │ │ ├── ResponseMessage.java
│ │ │ │ │ │ ├── StringMessage.java
│ │ │ │ │ │ ├── appllication/
│ │ │ │ │ │ │ ├── GetServerMessage.java
│ │ │ │ │ │ │ ├── LoginMessage.java
│ │ │ │ │ │ │ ├── RegisterMessage.java
│ │ │ │ │ │ │ ├── ResetPasswordMessage.java
│ │ │ │ │ │ │ └── sharing/
│ │ │ │ │ │ │ └── ShareLoginMessage.java
│ │ │ │ │ │ ├── common/
│ │ │ │ │ │ │ └── HardwareMessage.java
│ │ │ │ │ │ └── hardware/
│ │ │ │ │ │ └── HardwareLoginMessage.java
│ │ │ │ │ ├── reporting/
│ │ │ │ │ │ ├── GraphPinRequest.java
│ │ │ │ │ │ ├── average/
│ │ │ │ │ │ │ ├── AggregationKey.java
│ │ │ │ │ │ │ ├── AggregationValue.java
│ │ │ │ │ │ │ └── AverageAggregatorProcessor.java
│ │ │ │ │ │ └── raw/
│ │ │ │ │ │ ├── BaseReportingKey.java
│ │ │ │ │ │ ├── GraphValue.java
│ │ │ │ │ │ ├── RawDataCacheForGraphProcessor.java
│ │ │ │ │ │ └── RawDataProcessor.java
│ │ │ │ │ ├── session/
│ │ │ │ │ │ ├── HardwareStateHolder.java
│ │ │ │ │ │ └── StateHolderBase.java
│ │ │ │ │ └── stats/
│ │ │ │ │ ├── EWMA.java
│ │ │ │ │ ├── GlobalStats.java
│ │ │ │ │ ├── Meter.java
│ │ │ │ │ ├── metrics/
│ │ │ │ │ │ └── InstanceLoadMeter.java
│ │ │ │ │ └── model/
│ │ │ │ │ ├── BlockingIOStat.java
│ │ │ │ │ ├── CommandStat.java
│ │ │ │ │ ├── HttpStat.java
│ │ │ │ │ ├── MemoryStat.java
│ │ │ │ │ └── Stat.java
│ │ │ │ ├── db/
│ │ │ │ │ ├── DBManager.java
│ │ │ │ │ ├── ReportingDBManager.java
│ │ │ │ │ ├── dao/
│ │ │ │ │ │ ├── CloneProjectDBDao.java
│ │ │ │ │ │ ├── FlashedTokensDBDao.java
│ │ │ │ │ │ ├── ForwardingTokenDBDao.java
│ │ │ │ │ │ ├── ForwardingTokenEntry.java
│ │ │ │ │ │ ├── PurchaseDBDao.java
│ │ │ │ │ │ ├── RedeemDBDao.java
│ │ │ │ │ │ ├── ReportingDBDao.java
│ │ │ │ │ │ └── UserDBDao.java
│ │ │ │ │ └── model/
│ │ │ │ │ ├── FlashedToken.java
│ │ │ │ │ ├── Purchase.java
│ │ │ │ │ └── Redeem.java
│ │ │ │ ├── internal/
│ │ │ │ │ ├── CommonByteBufUtil.java
│ │ │ │ │ ├── EmptyArraysUtil.java
│ │ │ │ │ ├── QuotaLimitChecker.java
│ │ │ │ │ ├── ReregisterChannelUtil.java
│ │ │ │ │ ├── SerializationUtil.java
│ │ │ │ │ ├── StateHolderUtil.java
│ │ │ │ │ └── token/
│ │ │ │ │ ├── BaseToken.java
│ │ │ │ │ ├── ResetPassToken.java
│ │ │ │ │ └── TokensPool.java
│ │ │ │ ├── transport/
│ │ │ │ │ └── TransportTypeHolder.java
│ │ │ │ └── workers/
│ │ │ │ ├── ReadingWidgetsWorker.java
│ │ │ │ └── timer/
│ │ │ │ ├── TimerKey.java
│ │ │ │ └── TimerWorker.java
│ │ │ └── module-info.java
│ │ └── resources/
│ │ ├── create_schema.sql
│ │ ├── db.properties
│ │ ├── dynamic_provisioning_mail.html
│ │ ├── migrataion.temp
│ │ ├── reporting_schema.sql
│ │ ├── server.properties
│ │ ├── single_token_mail_body.txt
│ │ ├── static_provisioning_mail.html
│ │ └── template_id_mail.html
│ └── test/
│ ├── java/
│ │ └── cc/
│ │ └── blynk/
│ │ ├── server/
│ │ │ ├── core/
│ │ │ │ ├── dao/
│ │ │ │ │ ├── CSVGeneratorTest.java
│ │ │ │ │ ├── ReportingDaoTest.java
│ │ │ │ │ └── functions/
│ │ │ │ │ └── MedianGraphFunctionTest.java
│ │ │ │ ├── device/
│ │ │ │ │ └── SerializationForBoardTypeTest.java
│ │ │ │ ├── model/
│ │ │ │ │ ├── CopyObjectTest.java
│ │ │ │ │ ├── DataStreamStorageSerializationTest.java
│ │ │ │ │ ├── DataStreamValuesUpdateCorrectTest.java
│ │ │ │ │ └── widgets/
│ │ │ │ │ ├── DataStreamGetJsonValueTest.java
│ │ │ │ │ ├── MultiPinWidgetsToJsonTest.java
│ │ │ │ │ ├── others/
│ │ │ │ │ │ └── RTCSerializationTest.java
│ │ │ │ │ └── ui/
│ │ │ │ │ ├── TableSerializationTest.java
│ │ │ │ │ └── reporting/
│ │ │ │ │ └── ReportingModelTest.java
│ │ │ │ └── reporting/
│ │ │ │ └── average/
│ │ │ │ └── AverageAggregatorTest.java
│ │ │ ├── db/
│ │ │ │ ├── CloneProjectTest.java
│ │ │ │ ├── DBManagerTest.java
│ │ │ │ ├── FlashedTokensManagerTest.java
│ │ │ │ ├── ForwardingTokenTest.java
│ │ │ │ ├── RawDataDBTest.java
│ │ │ │ └── RealtimeStatsDBTest.java
│ │ │ └── internal/
│ │ │ └── SerializationTokenPoolTest.java
│ │ └── test/
│ │ └── utils/
│ │ ├── FileManagerIntegrationTest.java
│ │ ├── JsonParsingTest.java
│ │ ├── NumberUtilTest.java
│ │ ├── StringUtilPerfTest.java
│ │ ├── StringUtilsTest.java
│ │ └── UserStatisticsTest.java
│ └── resources/
│ ├── db-test.properties
│ ├── json_test/
│ │ ├── user_ios_profile_json.txt
│ │ ├── user_profile_json.txt
│ │ ├── user_profile_json_2.txt
│ │ ├── user_profile_json_3.txt
│ │ ├── user_profile_json_4.txt
│ │ ├── user_profile_json_5.txt
│ │ ├── user_profile_json_RGB.txt
│ │ ├── user_profile_json_old_pinstorage.txt
│ │ ├── user_profile_json_with_outdated_widget.txt
│ │ └── user_profile_with_timer.txt
│ └── log4j2-test.xml
├── http-admin/
│ ├── pom.xml
│ └── src/
│ ├── main/
│ │ ├── java/
│ │ │ ├── cc/
│ │ │ │ └── blynk/
│ │ │ │ └── server/
│ │ │ │ └── admin/
│ │ │ │ └── http/
│ │ │ │ ├── handlers/
│ │ │ │ │ └── IpFilterHandler.java
│ │ │ │ ├── logic/
│ │ │ │ │ ├── Config.java
│ │ │ │ │ ├── ConfigsLogic.java
│ │ │ │ │ ├── HardwareStatsLogic.java
│ │ │ │ │ ├── OTALogic.java
│ │ │ │ │ ├── StatsLogic.java
│ │ │ │ │ └── UsersLogic.java
│ │ │ │ └── response/
│ │ │ │ ├── IpNameResponse.java
│ │ │ │ └── RequestPerSecondResponse.java
│ │ │ └── module-info.java
│ │ └── resources/
│ │ └── static/
│ │ ├── admin.html
│ │ ├── css/
│ │ │ └── blynk.css
│ │ ├── js/
│ │ │ ├── admin.js
│ │ │ ├── core-min.js
│ │ │ ├── enc-base64-min.js
│ │ │ ├── login.js
│ │ │ └── sha256-min.js
│ │ └── login.html
│ └── test/
│ └── java/
│ └── cc/
│ └── blynk/
│ └── server/
│ ├── admin/
│ │ └── http/
│ │ ├── handlers/
│ │ │ └── IpFilterHandlerTest.java
│ │ └── logic/
│ │ └── admin/
│ │ └── UsersLogicTest.java
│ └── reset/
│ └── SHA256UtilTest.java
├── http-api/
│ ├── pom.xml
│ └── src/
│ ├── main/
│ │ ├── java/
│ │ │ └── cc/
│ │ │ └── blynk/
│ │ │ └── server/
│ │ │ └── api/
│ │ │ ├── http/
│ │ │ │ ├── handlers/
│ │ │ │ │ ├── BaseHttpAndBlynkUnificationHandler.java
│ │ │ │ │ ├── BaseWebSocketUnificator.java
│ │ │ │ │ └── LetsEncryptHandler.java
│ │ │ │ ├── logic/
│ │ │ │ │ ├── HttpAPILogic.java
│ │ │ │ │ ├── ResetPasswordHttpLogic.java
│ │ │ │ │ └── business/
│ │ │ │ │ ├── AdminAuthHandler.java
│ │ │ │ │ └── AuthCookieHandler.java
│ │ │ │ └── pojo/
│ │ │ │ ├── EmailPojo.java
│ │ │ │ ├── PinData.java
│ │ │ │ └── PushMessagePojo.java
│ │ │ └── websockets/
│ │ │ └── handlers/
│ │ │ ├── WSHandler.java
│ │ │ └── WSWrapperEncoder.java
│ │ └── resources/
│ │ └── static/
│ │ └── reset/
│ │ ├── enterNewPassword.html
│ │ ├── reset-email-app-confirmation.html
│ │ ├── reset-email-app.html
│ │ ├── reset-email.html
│ │ └── site.css
│ └── test/
│ └── java/
│ └── cc/
│ └── blynk/
│ └── server/
│ ├── api/
│ │ └── http/
│ │ ├── logic/
│ │ │ ├── HttpSignatureTest.java
│ │ │ └── TestHideSecureInfoForCloning.java
│ │ └── pojo/
│ │ └── TestDataStreamDataJson.java
│ └── reset/
│ └── TokensPoolTest.java
├── http-core/
│ ├── pom.xml
│ └── src/
│ ├── main/
│ │ └── java/
│ │ ├── cc/
│ │ │ └── blynk/
│ │ │ └── core/
│ │ │ └── http/
│ │ │ ├── AnnotationsProcessor.java
│ │ │ ├── AuthHeadersBaseHttpHandler.java
│ │ │ ├── BaseHttpHandler.java
│ │ │ ├── CookiesBaseHttpHandler.java
│ │ │ ├── Response.java
│ │ │ ├── TokenBaseHttpHandler.java
│ │ │ ├── UriTemplate.java
│ │ │ ├── annotation/
│ │ │ │ ├── Consumes.java
│ │ │ │ ├── Context.java
│ │ │ │ ├── DELETE.java
│ │ │ │ ├── EnumQueryParam.java
│ │ │ │ ├── FormParam.java
│ │ │ │ ├── GET.java
│ │ │ │ ├── HttpMethod.java
│ │ │ │ ├── Metric.java
│ │ │ │ ├── POST.java
│ │ │ │ ├── PUT.java
│ │ │ │ ├── Path.java
│ │ │ │ ├── PathParam.java
│ │ │ │ └── QueryParam.java
│ │ │ ├── handlers/
│ │ │ │ ├── BlynkHttpPostMultipartRequestDecoder.java
│ │ │ │ ├── BlynkHttpPostRequestDecoder.java
│ │ │ │ ├── CookieBasedUrlReWriterHandler.java
│ │ │ │ ├── HttpPostBodyUtil.java
│ │ │ │ ├── NoCacheStaticFile.java
│ │ │ │ ├── NoMatchHandler.java
│ │ │ │ ├── OTAHandler.java
│ │ │ │ ├── StaticFile.java
│ │ │ │ ├── StaticFileEdsWith.java
│ │ │ │ ├── StaticFileHandler.java
│ │ │ │ ├── UploadHandler.java
│ │ │ │ └── url/
│ │ │ │ ├── UrlMapper.java
│ │ │ │ └── UrlReWriterHandler.java
│ │ │ ├── model/
│ │ │ │ ├── Filter.java
│ │ │ │ └── NameCountResponse.java
│ │ │ ├── rest/
│ │ │ │ ├── HandlerHolder.java
│ │ │ │ ├── HandlerWrapper.java
│ │ │ │ ├── RequestHeaderParam.java
│ │ │ │ ├── URIDecoder.java
│ │ │ │ └── params/
│ │ │ │ ├── BodyParam.java
│ │ │ │ ├── ContextParam.java
│ │ │ │ ├── EnumQueryParam.java
│ │ │ │ ├── FormParam.java
│ │ │ │ ├── Param.java
│ │ │ │ ├── PathParam.java
│ │ │ │ └── QueryParam.java
│ │ │ └── utils/
│ │ │ ├── AdminHttpUtil.java
│ │ │ ├── ContentTypeUtil.java
│ │ │ └── ListUtils.java
│ │ └── module-info.java
│ └── test/
│ └── java/
│ └── cc/
│ └── blynk/
│ ├── core/
│ │ └── http/
│ │ └── UriTemplateTest.java
│ └── test/
│ └── ListUtilsTest.java
├── launcher/
│ ├── pom.xml
│ └── src/
│ ├── main/
│ │ ├── java/
│ │ │ └── cc/
│ │ │ └── blynk/
│ │ │ ├── cli/
│ │ │ │ ├── AlreadySelectedException.java
│ │ │ │ ├── AmbiguousOptionException.java
│ │ │ │ ├── CommandLine.java
│ │ │ │ ├── DefaultParser.java
│ │ │ │ ├── MissingArgumentException.java
│ │ │ │ ├── MissingOptionException.java
│ │ │ │ ├── Option.java
│ │ │ │ ├── OptionGroup.java
│ │ │ │ ├── OptionValidator.java
│ │ │ │ ├── Options.java
│ │ │ │ ├── ParseException.java
│ │ │ │ ├── UnrecognizedOptionException.java
│ │ │ │ └── Util.java
│ │ │ ├── server/
│ │ │ │ ├── launcher/
│ │ │ │ │ ├── ArgumentsParser.java
│ │ │ │ │ ├── JobLauncher.java
│ │ │ │ │ └── ServerLauncher.java
│ │ │ │ ├── servers/
│ │ │ │ │ ├── BaseServer.java
│ │ │ │ │ ├── application/
│ │ │ │ │ │ └── MobileAndHttpsServer.java
│ │ │ │ │ └── hardware/
│ │ │ │ │ ├── HardwareAndHttpAPIServer.java
│ │ │ │ │ └── MQTTHardwareServer.java
│ │ │ │ └── workers/
│ │ │ │ ├── CertificateRenewalWorker.java
│ │ │ │ ├── HistoryGraphUnusedPinDataCleanerWorker.java
│ │ │ │ ├── ProfileSaverWorker.java
│ │ │ │ ├── ReportingTruncateWorker.java
│ │ │ │ ├── ReportingWorker.java
│ │ │ │ ├── ShutdownHookWorker.java
│ │ │ │ └── StatsWorker.java
│ │ │ └── utils/
│ │ │ └── LoggerUtil.java
│ │ └── resources/
│ │ └── log4j2.xml
│ └── test/
│ └── java/
│ └── cc/
│ └── blynk/
│ └── server/
│ └── workers/
│ ├── ProfileSaverWorkerTest.java
│ └── ReportingWorkerTest.java
├── notifications/
│ ├── email/
│ │ ├── pom.xml
│ │ └── src/
│ │ ├── main/
│ │ │ ├── java/
│ │ │ │ ├── cc/
│ │ │ │ │ └── blynk/
│ │ │ │ │ └── server/
│ │ │ │ │ └── notifications/
│ │ │ │ │ └── mail/
│ │ │ │ │ ├── GMailClient.java
│ │ │ │ │ ├── MailClient.java
│ │ │ │ │ ├── MailWrapper.java
│ │ │ │ │ ├── QrHolder.java
│ │ │ │ │ ├── ResetQrHolder.java
│ │ │ │ │ └── ThirdPartyMailClient.java
│ │ │ │ └── module-info.java
│ │ │ └── resources/
│ │ │ └── mail.properties
│ │ └── test/
│ │ ├── java/
│ │ │ └── cc/
│ │ │ └── blynk/
│ │ │ └── server/
│ │ │ └── notifications/
│ │ │ └── mail/
│ │ │ └── MailWrapperTest.java
│ │ └── resources/
│ │ ├── amazon.properties
│ │ ├── mail.properties
│ │ ├── sparkpost-http.properties
│ │ └── sparkpost-smtp.properties
│ ├── pom.xml
│ ├── push/
│ │ ├── pom.xml
│ │ └── src/
│ │ ├── main/
│ │ │ ├── java/
│ │ │ │ ├── cc/
│ │ │ │ │ └── blynk/
│ │ │ │ │ └── server/
│ │ │ │ │ └── notifications/
│ │ │ │ │ └── push/
│ │ │ │ │ ├── GCMMessage.java
│ │ │ │ │ ├── GCMResponseMessage.java
│ │ │ │ │ ├── GCMResult.java
│ │ │ │ │ ├── GCMWrapper.java
│ │ │ │ │ ├── android/
│ │ │ │ │ │ ├── AndroidBody.java
│ │ │ │ │ │ └── AndroidGCMMessage.java
│ │ │ │ │ ├── enums/
│ │ │ │ │ │ └── Priority.java
│ │ │ │ │ └── ios/
│ │ │ │ │ ├── IOSBody.java
│ │ │ │ │ └── IOSGCMMessage.java
│ │ │ │ └── module-info.java
│ │ │ └── resources/
│ │ │ └── gcm.properties
│ │ └── test/
│ │ └── java/
│ │ └── cc/
│ │ └── blynk/
│ │ └── server/
│ │ └── notifications/
│ │ └── push/
│ │ └── GCMWrapperTest.java
│ ├── sms/
│ │ ├── pom.xml
│ │ └── src/
│ │ ├── main/
│ │ │ ├── java/
│ │ │ │ ├── cc/
│ │ │ │ │ └── blynk/
│ │ │ │ │ └── server/
│ │ │ │ │ └── notifications/
│ │ │ │ │ └── sms/
│ │ │ │ │ ├── SMSWrapper.java
│ │ │ │ │ └── SmsResponse.java
│ │ │ │ └── module-info.java
│ │ │ └── resources/
│ │ │ └── sms.properties
│ │ └── test/
│ │ └── java/
│ │ └── cc/
│ │ └── blynk/
│ │ └── server/
│ │ └── notifications/
│ │ └── sms/
│ │ └── TestSendSms.java
│ └── twitter/
│ ├── pom.xml
│ └── src/
│ ├── main/
│ │ └── java/
│ │ ├── cc/
│ │ │ └── blynk/
│ │ │ └── server/
│ │ │ └── notifications/
│ │ │ └── twitter/
│ │ │ └── TwitterWrapper.java
│ │ └── module-info.java
│ └── test/
│ ├── java/
│ │ └── cc/
│ │ └── blynk/
│ │ └── server/
│ │ └── notifications/
│ │ └── twitter/
│ │ └── TwitterWrapperTest.java
│ └── resources/
│ └── twitter4j.properties
├── pom.xml
├── tcp-app-server/
│ ├── pom.xml
│ └── src/
│ ├── main/
│ │ ├── java/
│ │ │ └── cc/
│ │ │ └── blynk/
│ │ │ ├── server/
│ │ │ │ └── application/
│ │ │ │ └── handlers/
│ │ │ │ ├── main/
│ │ │ │ │ ├── MobileChannelStateHandler.java
│ │ │ │ │ ├── MobileHandler.java
│ │ │ │ │ ├── MobileResetPasswordHandler.java
│ │ │ │ │ ├── auth/
│ │ │ │ │ │ ├── LimitChecker.java
│ │ │ │ │ │ ├── MobileGetServerHandler.java
│ │ │ │ │ │ ├── MobileLoginHandler.java
│ │ │ │ │ │ ├── MobileRegisterHandler.java
│ │ │ │ │ │ ├── MobileStateHolder.java
│ │ │ │ │ │ ├── OsType.java
│ │ │ │ │ │ └── Version.java
│ │ │ │ │ └── logic/
│ │ │ │ │ ├── LoadSharedProfileGzippedLogic.java
│ │ │ │ │ ├── MobileActivateDashboardLogic.java
│ │ │ │ │ ├── MobileAddPushLogic.java
│ │ │ │ │ ├── MobileAssignTokenLogic.java
│ │ │ │ │ ├── MobileDeActivateDashboardLogic.java
│ │ │ │ │ ├── MobileGetCloneCodeLogic.java
│ │ │ │ │ ├── MobileGetEnergyLogic.java
│ │ │ │ │ ├── MobileGetProjectByClonedTokenLogic.java
│ │ │ │ │ ├── MobileGetProjectByTokenLogic.java
│ │ │ │ │ ├── MobileGetProvisionTokenLogic.java
│ │ │ │ │ ├── MobileHardwareLogic.java
│ │ │ │ │ ├── MobileHardwareResendFromBTLogic.java
│ │ │ │ │ ├── MobileLoadProfileGzippedLogic.java
│ │ │ │ │ ├── MobileLogoutLogic.java
│ │ │ │ │ ├── MobileMailLogic.java
│ │ │ │ │ ├── MobilePurchaseLogic.java
│ │ │ │ │ ├── MobileRedeemLogic.java
│ │ │ │ │ ├── MobileRefreshTokenLogic.java
│ │ │ │ │ ├── MobileSetWidgetPropertyLogic.java
│ │ │ │ │ ├── MobileSyncLogic.java
│ │ │ │ │ ├── dashboard/
│ │ │ │ │ │ ├── MobileCreateDashLogic.java
│ │ │ │ │ │ ├── MobileDeleteDashLogic.java
│ │ │ │ │ │ ├── MobileUpdateDashLogic.java
│ │ │ │ │ │ ├── MobileUpdateDashSettingLogic.java
│ │ │ │ │ │ ├── device/
│ │ │ │ │ │ │ ├── MobileCreateDeviceLogic.java
│ │ │ │ │ │ │ ├── MobileDeleteDeviceLogic.java
│ │ │ │ │ │ │ ├── MobileGetDeviceLogic.java
│ │ │ │ │ │ │ ├── MobileGetDevicesLogic.java
│ │ │ │ │ │ │ └── MobileUpdateDeviceLogic.java
│ │ │ │ │ │ ├── tags/
│ │ │ │ │ │ │ ├── MobileCreateTagLogic.java
│ │ │ │ │ │ │ ├── MobileDeleteTagLogic.java
│ │ │ │ │ │ │ ├── MobileGetTagsLogic.java
│ │ │ │ │ │ │ └── MobileUpdateTagLogic.java
│ │ │ │ │ │ └── widget/
│ │ │ │ │ │ ├── MobileCreateWidgetLogic.java
│ │ │ │ │ │ ├── MobileDeleteWidgetLogic.java
│ │ │ │ │ │ ├── MobileGetWidgetLogic.java
│ │ │ │ │ │ ├── MobileUpdateWidgetLogic.java
│ │ │ │ │ │ └── tile/
│ │ │ │ │ │ ├── MobileCreateTileTemplateLogic.java
│ │ │ │ │ │ ├── MobileDeleteTileTemplateLogic.java
│ │ │ │ │ │ └── MobileUpdateTileTemplateLogic.java
│ │ │ │ │ ├── face/
│ │ │ │ │ │ ├── MobileCreateAppLogic.java
│ │ │ │ │ │ ├── MobileDeleteAppLogic.java
│ │ │ │ │ │ ├── MobileMailQRsLogic.java
│ │ │ │ │ │ ├── MobileUpdateAppLogic.java
│ │ │ │ │ │ └── MobileUpdateFaceLogic.java
│ │ │ │ │ ├── graph/
│ │ │ │ │ │ ├── MobileDeleteDeviceDataLogic.java
│ │ │ │ │ │ ├── MobileDeleteEnhancedGraphDataLogic.java
│ │ │ │ │ │ ├── MobileExportGraphDataLogic.java
│ │ │ │ │ │ ├── MobileGetEnhancedGraphDataLogic.java
│ │ │ │ │ │ └── links/
│ │ │ │ │ │ └── DeviceFileLink.java
│ │ │ │ │ ├── reporting/
│ │ │ │ │ │ ├── MobileCreateReportLogic.java
│ │ │ │ │ │ ├── MobileDeleteReportLogic.java
│ │ │ │ │ │ ├── MobileExportReportLogic.java
│ │ │ │ │ │ └── MobileUpdateReportLogic.java
│ │ │ │ │ └── sharing/
│ │ │ │ │ ├── MobileGetShareTokenLogic.java
│ │ │ │ │ ├── MobileRefreshShareTokenLogic.java
│ │ │ │ │ └── MobileShareLogic.java
│ │ │ │ └── sharing/
│ │ │ │ ├── MobileShareHandler.java
│ │ │ │ ├── auth/
│ │ │ │ │ ├── MobileShareLoginHandler.java
│ │ │ │ │ └── MobileShareStateHolder.java
│ │ │ │ └── logic/
│ │ │ │ └── MobileShareHardwareLogic.java
│ │ │ └── utils/
│ │ │ └── MobileStateHolderUtil.java
│ │ └── resources/
│ │ └── static/
│ │ ├── register-email.html
│ │ └── report-email.html
│ └── test/
│ └── java/
│ └── cc/
│ └── blynk/
│ ├── server/
│ │ └── application/
│ │ └── handlers/
│ │ ├── GetGraphDataHandlerTest.java
│ │ └── main/
│ │ ├── auth/
│ │ │ ├── RegistrationLimitCheckerTest.java
│ │ │ └── VersionTest.java
│ │ └── logic/
│ │ └── reporting/
│ │ ├── CreateReportTestTimingTest.java
│ │ └── ExportGraphDataLogicTest.java
│ └── utils/
│ └── EMailValidationTest.java
├── tcp-hardware-server/
│ ├── pom.xml
│ └── src/
│ ├── main/
│ │ └── java/
│ │ └── cc/
│ │ └── blynk/
│ │ └── server/
│ │ └── hardware/
│ │ ├── handlers/
│ │ │ └── hardware/
│ │ │ ├── HardwareChannelStateHandler.java
│ │ │ ├── HardwareHandler.java
│ │ │ ├── MqttHardwareHandler.java
│ │ │ ├── auth/
│ │ │ │ └── HardwareLoginHandler.java
│ │ │ ├── logic/
│ │ │ │ ├── BlynkInternalLogic.java
│ │ │ │ ├── BridgeLogic.java
│ │ │ │ ├── HardwareLogic.java
│ │ │ │ ├── HardwareSyncLogic.java
│ │ │ │ ├── MailLogic.java
│ │ │ │ ├── PushLogic.java
│ │ │ │ ├── SetWidgetPropertyLogic.java
│ │ │ │ ├── SmsLogic.java
│ │ │ │ └── TwitLogic.java
│ │ │ └── mqtt/
│ │ │ ├── auth/
│ │ │ │ └── MqttHardwareLoginHandler.java
│ │ │ └── logic/
│ │ │ └── MqttHardwareLogic.java
│ │ └── internal/
│ │ └── BridgeForwardMessage.java
│ └── test/
│ └── java/
│ └── cc/
│ └── blynk/
│ └── server/
│ └── hardware/
│ └── handlers/
│ └── TwitHandlerTest.java
├── tcp-web-server/
│ └── pom.xml
├── tools/
│ ├── pom.xml
│ └── src/
│ ├── main/
│ │ └── java/
│ │ └── cc/
│ │ └── blynk/
│ │ └── server/
│ │ └── tools/
│ │ ├── ForwardingTokenGenerator.java
│ │ └── ReportingDataCleaner.java
│ └── test/
│ └── java/
│ └── cc/
│ └── blynk/
│ └── server/
│ └── tools/
│ └── ReportingDataCleanerTest.java
└── utils/
├── pom.xml
└── src/
├── main/
│ └── java/
│ ├── cc/
│ │ └── blynk/
│ │ └── utils/
│ │ ├── AppNameUtil.java
│ │ ├── ArrayUtil.java
│ │ ├── BlynkTPFactory.java
│ │ ├── ByteUtils.java
│ │ ├── DateTimeUtils.java
│ │ ├── FileLoaderUtil.java
│ │ ├── FileUtils.java
│ │ ├── IPUtils.java
│ │ ├── IntArray.java
│ │ ├── JarUtil.java
│ │ ├── KMPMatch.java
│ │ ├── NumberUtil.java
│ │ ├── ReflectionUtil.java
│ │ ├── ReportingUtil.java
│ │ ├── SHA256Util.java
│ │ ├── StringUtils.java
│ │ ├── TokenGeneratorUtil.java
│ │ ├── http/
│ │ │ ├── ContentType.java
│ │ │ └── MediaType.java
│ │ ├── properties/
│ │ │ ├── BaseProperties.java
│ │ │ ├── DBProperties.java
│ │ │ ├── GCMProperties.java
│ │ │ ├── MailProperties.java
│ │ │ ├── Placeholders.java
│ │ │ ├── ServerProperties.java
│ │ │ ├── SmsProperties.java
│ │ │ └── TwitterProperties.java
│ │ ├── structure/
│ │ │ ├── BaseLimitedQueue.java
│ │ │ ├── LCDLimitedQueue.java
│ │ │ ├── LRUCache.java
│ │ │ ├── LimitedArrayDeque.java
│ │ │ ├── MapLimitedQueue.java
│ │ │ ├── TableLimitedQueue.java
│ │ │ └── TerminalLimitedQueue.java
│ │ └── validators/
│ │ ├── BlynkEmailValidator.java
│ │ ├── DomainValidator.java
│ │ ├── EmailValidator.java
│ │ ├── InetAddressValidator.java
│ │ └── RegexValidator.java
│ └── module-info.java
└── test/
└── java/
└── cc/
└── blynk/
└── utils/
└── structure/
├── IntArrayTest.java
├── LimitedArrayDequeTest.java
└── LimitedQueueTest.java
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
# Created by .ignore support plugin (hsz.mobi)
*.iml
.idea
target
*.log
dependency-reduced-pom.xml
================================================
FILE: .travis.yml
================================================
language: java
jdk:
- oraclejdk10
addons:
postgresql: "9.5"
services:
- postgresql
before_script:
- psql -f $TRAVIS_BUILD_DIR/server/core/src/main/resources/create_schema.sql -U postgres
script:
- mvn clean test
================================================
FILE: CODE_OF_CONDUCT.md
================================================
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at dmitriy@blynk.cc. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
================================================
FILE: CONTRIBUTING.md
================================================
## How to submit a bug report
Please ensure to specify the following:
* Blynk Server version (e.g. 0.28.0)
* Contextual information (e.g. what you were trying to achieve)
* Simplest possible steps to reproduce
* Anything that might be relevant in your opinion, such as:
* JDK/JRE version or the output of `java -version`
* Operating system and the output of `uname -a`
* Network configuration
### Example
```
Blynk Server version: 0.28.0
Context:
I encountered an exception which looks suspicious while running my Local Server.
Steps to reproduce:
1. ...
2. ...
3. ...
4. ...
$ java -version
java version "1.8.0_51"
Java(TM) SE Runtime Environment (build 1.8.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)
Operating system: Ubuntu Linux 14.04 64-bit
================================================
FILE: README.md
================================================
# What is Blynk?
### Note that this Blynk Legacy server is now discontinued and unsupported!
It does not work with the latest Blynk app, and the Legacy app will be withdrawn from the app/play stores from 30th June 2022.
Previously installed apps will continue to work, although later versions of the legacy app do not have the ability to
create new accounts, so the either an earlier version of the app will be needed, or accounst will need to be created manually
by copying and renaming the default Blynk.cc account.
The Legacy cloud servers will be decommissioned on 31st December 2022. This will have no impact on local legacy servers, but
as all support and updates for this legacy local server and the legacy apps apps has already ceased, using a local legacy server
should be seen as an interim measure, because the server will eventually become vulnerable when support for Java 11 is withdrawn
and when the apps no longer run on newer mobile OS releases.
Installing the iOS app after it is withdrawn from the app store will require jailbraking the Apple mobile device, and Android users
will need to source and side-load a copy of the legacy app outside of the playstore.
-----------------------------------------------------------------------------------------------------------------------------------
Blynk is a platform with iOS and Android apps to control Arduino, ESP8266, Raspberry Pi and the likes over the Internet.
You can easily build graphic interfaces for all your projects by simply dragging and dropping widgets.
If you need more information, please follow these links:
* [Blynk site](https://www.blynk.io)
* [Blynk docs](http://docs.blynk.cc)
* [Blynk community](https://community.blynk.cc)
* [Blynk Examples generator](https://examples.blynk.cc)
* [Facebook](http://www.fb.com/blynkapp)
* [Twitter](http://twitter.com/blynk_app)
* [App Store](https://itunes.apple.com/us/app/blynk-control-arduino-raspberry/id808760481?ls=1&mt=8)
* [Google Play](https://play.google.com/store/apps/details?id=cc.blynk)
* [Blynk library](https://github.com/blynkkk/blynk-library)
* [Kickstarter](https://www.kickstarter.com/projects/167134865/blynk-build-an-app-for-your-arduino-project-in-5-m/description)




# Content
- [Download](#blynk-server)
- [Requirements](#requirements)
- [Quick Local Server setup](#quick-local-server-setup)
- [Enabling mail on Local server](#enabling-mail-on-local-server)
- [Quick local server setup on Raspberry PI](#quick-local-server-setup-on-raspberry-pi)
- [Docker container setup](#docker-container-setup)
- [Enabling server auto restart on unix-like systems](#enabling-server-auto-restart-on-unix-like-systems)
- [Enabling server auto restart on Windows](#enabling-server-auto-restart-on-windows)
- [Update instruction for unix-like systems](#update-instruction-for-unix-like-systems)
- [Update instruction for Windows](#update-instruction-for-windows)
- [App and sketch changes for Local Server](#app-and-sketch-changes)
- [Advanced local server setup](#advanced-local-server-setup)
- [Administration UI](#administration-ui)
- [HTTP/S RESTful API](#https-restful)
- [Enabling sms on local server](#enabling-sms-on-local-server)
- [Enabling raw data storage](#enabling-raw-data-storage)
- [Automatic Let's Encrypt Certificates](#automatic-lets-encrypt-certificates-generation)
- [Manual Let's Encrypt SSL/TLS Certificates](#manual-lets-encrypt-ssltls-certificates)
- [Generate own SSL certificates](#generate-own-ssl-certificates)
- [Install java for Ubuntu](#install-java-for-ubuntu)
- [How Blynk Works?](#how-blynk-works)
- [Blynk Protocol](#blynk-protocol)
# GETTING STARTED
## Blynk server
Blynk Server is an Open-Source [Netty](https://github.com/netty/netty) based Java server, responsible for forwarding
messages between Blynk mobile application and various microcontroller boards and SBCs (i.e. Arduino, Raspberry Pi. etc).
**Download latest server build [here](https://github.com/Peterkn2001/blynk-server/releases).**
[](https://github.com/Peterkn2001/blynk-server/releases/latest)
[](https://github.com/Peterkn2001/blynk-server/releases/latest)
## Requirements
- Java 8/11 required (OpenJDK, Oracle)
- Any OS that can run java
- At least 30 MB of RAM (could be less with tuning)
- Open ports 9443 (for app and hardware with ssl), 8080 (for hardware without ssl)
[Ubuntu java installation instruction](#install-java-for-ubuntu).
For Windows download Java [here](https://www.oracle.com/technetwork/java/javase/downloads/jdk11-downloads-5066655.html) and install.
## Quick local server setup
+ Make sure you are using Java 11
java -version
Output: java version "11"
+ Run the server on default 'hardware port 8080' and default 'application port 9443' (SSL port)
java -jar server-0.41.16.jar -dataFolder /path
That's it!
**NOTE: ```/path``` should be real existing path to folder where you want to store all your data.**
+ As an output you should see something like that:
Blynk Server successfully started.
All server output is stored in current folder in 'logs/blynk.log' file.
### Enabling mail on Local server
### NOTE - From May 30th 2022 Google has stopped allowing less secure applications on personal Gmail accounts, so email from the Blynk local server will not be possible in most cases.
To enable mail notifications on Local server you need to provide your own mail credentials. Create file `mail.properties` within same folder where `server.jar` is.
Mail properties:
mail.smtp.auth=true
mail.smtp.starttls.enable=true
mail.smtp.host=smtp.gmail.com
mail.smtp.port=587
mail.smtp.username=YOUR_EMAIL_HERE
mail.smtp.password=YOUR_EMAIL_PASS_HERE
Find example [here](https://github.com/Peterkn2001/blynk-server/blob/master/server/notifications/email/src/main/resources/mail.properties).
WARNING : only gmail accounts are allowed.
NOTE : you'll need to setup Gmail to allow less secure applications.
Go [here](https://www.google.com/settings/security/lesssecureapps) and then click "Allow less secure apps".
## Quick local server setup on Raspberry PI
+ Login to Raspberry Pi via ssh;
+ Install java 8:
sudo apt install openjdk-8-jdk openjdk-8-jre
+ Make sure you are using Java 8
java -version
Output: java version "1.8"
+ Download Blynk server jar file (or manually copy it to Raspberry Pi via ssh and scp command):
wget "https://github.com/Peterkn2001/blynk-server/releases/download/v0.41.16/server-0.41.16-java8.jar"
+ Run the server on default 'hardware port 8080' and default 'application port 9443' (SSL port)
java -jar server-0.41.16-java8.jar -dataFolder /home/pi/Blynk
That's it!
+ As output you will see something like that:
Blynk Server successfully started.
All server output is stored in current folder in 'logs/blynk.log' file.
## Docker container setup
### Quick Launch
+ Install [Docker](https://docs.docker.com/install/)
+ Run Docker container
docker run -p 8080:8080 -p 9443:9443 mpherg/blynk-server
### Quick Launch on Raspberry Pi
+ Install [Docker](https://docs.docker.com/engine/install/debian/)
+ Run Docker container
docker run -p 8080:8080 -p 9443:9443 linuxkonsult/rasbian-blynk
### Full customisation
+ Check [README](server/Docker) in docker folder
## Enabling server auto restart on unix-like systems
+ To enable server auto restart find /etc/rc.local file and add:
java -jar /home/pi/server-0.41.16-java8.jar -dataFolder /home/pi/Blynk &
+ Or if the approach above doesn't work, execute
crontab -e
add the following line
@reboot java -jar /home/pi/server-0.41.16-java8.jar -dataFolder /home/pi/Blynk &
save and exit.
## Enabling server auto restart on Windows
+ Create bat file:
start-blynk.bat
+ Put in it one line:
java -jar server-0.41.16.jar -dataFolder /home/pi/Blynk
+ Put bat file to windows startup folder
You can also use [this](https://github.com/Peterkn2001/blynk-server/tree/master/scripts/win) script to run server.
## Update instruction for unix-like systems
**IMPORTANT**
Server should be always updated before you update Blynk App. To update your server to a newer version you would need to kill old process and start a new one.
+ Find process id of Blynk server
ps -aux | grep java
+ You should see something like that
username 10539 1.0 12.1 3325808 428948 pts/76 Sl Jan22 9:11 java -jar server-0.41.16.jar
+ Kill the old process
kill 10539
10539 - blynk server process id from command output above.
+ Start new server [as usual](#quick-local-server-setup)
After this steps you can update Blynk app. Server version downgrade is not supported.
**WARNING!**
Please **do not** revert your server to lower versions. You may loose all of your data.
## Update instruction for Windows
+ Open Task Manager;
+ Find Java process;
+ Stop process;
+ Start new server [as usual](#quick-local-server-setup)
## App and sketch changes
+ Specify custom server path in your application


+ Change your ethernet sketch from
```
Blynk.begin(auth);
```
to
```
Blynk.begin(auth, "your_host", 8080);
```
or to
```
Blynk.begin(auth, IPAddress(xxx,xxx,xxx,xxx), 8080);
```
+ Change your WIFI sketch from
```
Blynk.begin(auth, SSID, pass));
```
to
```
Blynk.begin(auth, SSID, pass, "your_host", 8080);
```
or to
```
Blynk.begin(auth, SSID, pass, IPAddress(XXX,XXX,XXX,XXX), 8080);
```
+ Change your rasp PI javascript from
```
var blynk = new Blynk.Blynk(AUTH, options = {connector : new Blynk.TcpClient()});
```
to
```
var blynk = new Blynk.Blynk(AUTH, options= {addr:"xxx.xxx.xxx.xxx", port:8080});
```
+ or in case of USB when running blynk-ser.sh provide '-s' option with address of your local server
./blynk-ser.sh -s you_host_or_IP
**IMPORTANT**
Blynk is being constantly developed. Mobile apps and server are updated often. To avoid problems during updates either turn off auto-update for Blynk app, or update both local server and blynk app at same time to avoid possible migration issues.
**IMPORTANT**
Blynk local server is different from Blynk Cloud server. They are not related at all. You have to create new account when using Blynk local server.
## Advanced local server setup
For more flexibility you can extend server with more options by creating ```server.properties``` file in same folder as ```server.jar```.
Example could be found [here](https://github.com/Peterkn2001/blynk-server/blob/master/server/core/src/main/resources/server.properties).
You could also specify any path to ```server.properties``` file via command line argument ```-serverConfig```. You can
do the same with ```mail.properties``` via ```-mailConfig``` and ```sms.properties``` via ```-smsConfig```.
For example:
java -jar server-0.41.16-java8.jar -dataFolder /home/pi/Blynk -serverConfig /home/pi/someFolder/server.properties
Available server options:
+ Blynk app, https, web sockets, admin port
https.port=9443
+ Http, hardware and web sockets port
http.port=8080
+ For simplicity Blynk already provides server jar with built in SSL certificates, so you have working server out of the box via SSL/TLS sockets. But as certificate and it's private key are in public this is totally not secure. So in order to fix that you need to provide your own certificates. And change below properties with path to your cert. and private key and it's password. See how to generate self-signed certificates [here](#generate-ssl-certificates)
#points to cert and key that placed in same folder as running jar.
server.ssl.cert=./server_embedded.crt
server.ssl.key=./server_embedded.pem
server.ssl.key.pass=pupkin123
**Note**: if you use Let's Encrypt certificates you'll have to add ```#define BLYNK_SSL_USE_LETSENCRYPT``` before ```#include <BlynkSimpleEsp8266_SSL.h>``` in the Arduino Sketch for your hardware.
+ User profiles folder. Folder in which all users profiles will be stored. By default System.getProperty("java.io.tmpdir")/blynk used. Will be created if not exists
data.folder=/tmp/blynk
+ Folder for all application logs. Will be created if it doesn't exist. "." is dir from which you are running script.
logs.folder=./logs
+ Log debug level. Possible values: trace|debug|info|error. Defines how precise logging will be. From left to right -> maximum logging to minimum
log.level=trace
+ Maximum allowed number of user dashboards.
user.dashboard.max.limit=100
+ 100 Req/sec rate limit per user. You also may want to extend this limit on [hardware side](https://github.com/blynkkk/blynk-library/blob/f4e132652906d63d683abeed89f5d6ebe369e37a/Blynk/BlynkConfig.h#L42).
user.message.quota.limit=100
+ this setting defines how often you can send mail/tweet/push or any other notification. Specified in seconds
notifications.frequency.user.quota.limit=60
+ Maximum allowed user profile size. In Kb's.
user.profile.max.size=128
+ Number of strings to store in terminal widget (terminal history data)
terminal.strings.pool.size=25
+ Maximum allowed number of notification queue. Queue responsible for processing email, pushes, twits sending. Because of performance issue - those queue is processed in separate thread, this is required due to blocking nature of all above operations. Usually limit shouldn't be reached
notifications.queue.limit=5000
+ Number of threads for performing blocking operations - push, twits, emails, db queries. Recommended to hold this value low unless you have to perform a lot of blocking operations.
blocking.processor.thread.pool.limit=6
+ Period for flushing all user DB to disk. In millis
profile.save.worker.period=60000
+ Specifies maximum period of time when hardware socket could be idle. After which socket will be closed due to non activity. In seconds. Leave it empty for infinity timeout
hard.socket.idle.timeout=15
+ Mostly required for local servers setup in case user want to log raw data in CSV format. See [raw data] (#raw-data-storage) section for more info.
enable.raw.data.store=true
+ Url for opening admin page. Must start from "/". For "/admin" url path will look like that "https://127.0.0.1:9443/admin".
admin.rootPath=/admin
+ Comma separated list of administrator IPs. Allow access to admin UI only for those IPs. You may set it for 0.0.0.0/0 to allow access for all. You may use CIDR notation. For instance, 192.168.0.53/24.
allowed.administrator.ips=0.0.0.0/0
+ Default admin name and password. Will be created on initial server start
admin.email=admin@blynk.cc
admin.pass=admin
+ Host for reset password redirect and certificate generation. By default current server IP is taken from "eth" network interface. Could be replaced with more friendly hostname. It is recommended to override this property with your server IP to avoid possible problems of host resolving.
server.host=blynk-cloud.com
+ Email used for certificate registration, could be omitted in case you already specified it in mail.properties.
contact.email=pupkin@gmail.com
## Administration UI
Blynk server provides administration panel where you can monitor your server. It is accessible at this URL:
https://your_ip:9443/admin

**WARNING**
Please change default admin password and name right after login to admin page. **THIS IS SECURITY MEASURE**.
**WARNING**
Default ```allowed.administrator.ips``` setting allows access for everyone. In other words,
administration page available from any other computer. Please restrict access to it via property ```allowed.administrator.ips```.
### Turn off chrome https warning on localhost
- Paste in chrome
chrome://flags/#allow-insecure-localhost
- You should see highlighted text saying: "Allow invalid certificates for resources loaded from localhost". Click enable.
## HTTP/S RESTful
Blynk HTTP/S RESTful API allows to easily read and write values to/from Pins in Blynk apps and Hardware.
Http API description could be found [here](http://docs.blynkapi.apiary.io).
### Enabling sms on local server
To enable SMS notifications on Local Server you need to provide credentials for SMS gateway (currently Blynk server
supports only 1 provider - [Nexmo](https://www.nexmo.com/). You need to create file ```sms.properties```
within same folder where server.jar is.
nexmo.api.key=
nexmo.api.secret=
And fill in the above properties with the credentials you'll get from Nexmo. (Account -> Settings -> API settings).
You can also send SMS over email if your cell provider supports that. See [discussion](http://community.blynk.cc/t/sms-notification-for-important-alert/2542) for more details.
## Enabling raw data storage
By default raw data storage is disabled (as it consumes disk space a lot).
When you enable it, every ```Blynk.virtualWrite``` command will be saved to DB.
You will need to install PostgreSQL Database (**minimum required version is 9.5**) to enable this functionality:
#### 1. Enabling raw data on server
Enable raw data in ```server.properties``` :
enable.db=true
enable.raw.db.data.store=true
#### 2. Install PostgreSQL. Option A
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql postgresql-contrib
#### 2. Install PostgreSQL. Option B
sudo apt-get update
apt-get --no-install-recommends install postgresql-9.6 postgresql-contrib-9.6
#### 3. Download Blynk DB script
wget https://raw.githubusercontent.com/Peterkn2001Peterkn2001/blynk-server/master/server/core/src/main/resources/create_schema.sql
wget https://raw.githubusercontent.com/Peterkn2001/blynk-server/master/server/core/src/main/resources/reporting_schema.sql
#### 4. Move create_schema.sql and reporting_schema.sql to temp folder (to avoid permission problems)
mv create_schema.sql /tmp
mv reporting_schema.sql /tmp
Result:
/tmp/create_schema.sql
/tmp/reporting_schema.sql
Copy it to clipboard from your console.
#### 5. Connect to PostgreSQL
sudo su - postgres
psql
#### 6. Create Blynk DB and Reporting DB, test user and tables
\i /tmp/create_schema.sql
\i /tmp/reporting_schema.sql
```/tmp/create_schema.sql``` - is path from step 4.
You should see next output:
postgres=# \i /tmp/create_schema.sql
CREATE DATABASE
You are now connected to database "blynk" as user "postgres".
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE ROLE
GRANT
GRANT
#### Quit
\q
Now start your server and you should see next text in ```postgres.log``` file :
2017-03-02 16:17:18.367 - DB url : jdbc:postgresql://localhost:5432/blynk?tcpKeepAlive=true&socketTimeout=150
2017-03-02 16:17:18.367 - DB user : test
2017-03-02 16:17:18.367 - Connecting to DB...
2017-03-02 16:17:18.455 - Connected to database successfully.
WARNING:
Raw data may consume your disk space very quickly!
### CSV data format
Data format is:
value,timestamp,deviceId
For example:
10,1438022081332,0
Where ```10``` - value of pin.
```1438022081332``` - the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC.
To display the date/time in excel you may use formula:
=((COLUMN/(60*60*24)/1000+25569))
```0``` - device id
### Automatic Let's Encrypt certificates generation
Latest Blynk server has super cool feature - automatic Let's Encrypt certificates generation.
However, it has few requirements:
+ Add ```server.host``` property in ```server.properties``` file.
For example :
server.host=myhost.com
IP is not supported, this is the limitation of Let's Encrypt. Also have in mind that ```myhost.com```
should be resolved by public DNS severs.
+ Add ```contact.email``` property in ```server.properties```. For example :
contact.email=test@gmail.com
+ You need to start server on port 80 (requires root or admin rights) or
make [port forwarding](#port-forwarding-for-https-api) to default Blynk HTTP port - 8080.
That's it! Run server as regular and certificates will be generated automatically.

### Manual Let's Encrypt SSL/TLS Certificates
+ First install [certbot](https://github.com/certbot/certbot) on your server (machine where you going to run Blynk Server)
wget https://dl.eff.org/certbot-auto
chmod a+x certbot-auto
+ Generate and verify certificates (your server should be connected to internet and have open 80/443 ports)
./certbot-auto certonly --agree-tos --email YOUR_EMAIL --standalone -d YOUR_HOST
For example
./certbot-auto certonly --agree-tos --email pupkin@blynk.cc --standalone -d blynk.cc
+ Then add to your ```server.properties``` file (in folder with server.jar)
server.ssl.cert=/etc/letsencrypt/live/YOUR_HOST/fullchain.pem
server.ssl.key=/etc/letsencrypt/live/YOUR_HOST/privkey.pem
server.ssl.key.pass=
### Generate own SSL certificates
+ Generate self-signed certificate and key
openssl req -x509 -nodes -days 1825 -newkey rsa:2048 -keyout server.key -out server.crt
+ Convert server.key to PKCS#8 private key file in PEM format
openssl pkcs8 -topk8 -v1 PBE-SHA1-2DES -in server.key -out server.enc.key
If you connect hardware with [USB script](https://github.com/blynkkk/blynk-library/tree/master/scripts) you have to provide an option '-s' pointing to "common name" (hostname) you did specified during certificate generation.
As an output you'll retrieve server.crt and server.pem files that you need to provide for server.ssl properties.
### Install java for Ubuntu
sudo add-apt-repository ppa:openjdk-r/ppa \
&& sudo apt-get update -q \
&& sudo apt install -y openjdk-11-jdk
or if above doesn't work:
sudo apt-add-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
### Port forwarding for HTTP/S API
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
sudo iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-port 9443
### Enabling QR generation on server
sudo apt-get install libxrender1
### Behind wifi router
If you want to run Blynk server behind WiFi-router and want it to be accessible from the Internet, you have to add port-forwarding rule on your router. This is required in order to forward all of the requests that come to the router within the local network to Blynk server.
### How to build
Blynk has a bunch of integration tests that require DB, so you have to skip tests during build.
mvn clean install -Dmaven.test.skip=true
### How Blynk Works?
When hardware connects to Blynk cloud it opens either keep-alive ssl/tls connection on port 443 (9443 for local servers) or keep-alive plain
tcp/ip connection on port 8080. Blynk app opens mutual ssl/tls connection to Blynk Cloud on port 443 (9443 for local servers).
Blynk Cloud is responsible for forwarding messages between hardware and app. In both (app and hardware) connections Blynk uses
own binary protocol described below.
### Blynk protocol
#### Hardware side protocol
Blynk transfers binary messages between the server and the hardware with the following structure:
| Command | Message Id | Length/Status | Body |
|:-------------:|:-------------:|:---------------:|:--------:|
| 1 byte | 2 bytes | 2 bytes | Variable |
Command and Status definitions: [BlynkProtocolDefs.h](https://github.com/Peterkn2001/blynk-library/blob/7e942d661bc54ded310bf5d00edee737d0ca44d7/src/Blynk/BlynkProtocolDefs.h)
#### Mobile app side protocol
Blynk transfers binary messages between the server and mobile app with the following structure:
| Command | Message Id | Length/Status | Body |
|:-------------:|:-------------:|:---------------:|:--------:|
| 1 byte | 2 bytes | 4 bytes | Variable |
#### Websockets web side protocol
Blynk transfers binary messages between the server and websockets (for web) with the following structure:
| Websocket header | Command | Message Id | Body |
|:------------------:|:-------------:|:-------------:|:--------:|
| | 1 byte | 2 bytes | Variable |
When command code == 0, than message structure is next:
| Websocket header | Command | Message Id | Response code |
|:------------------:|:-------------:|:-------------:|:-------------:|
| | 1 byte | 2 bytes | 4 bytes |
[Possible response codes](https://github.com/Peterkn2001/blynk-server/blob/master/server/core/src/main/java/cc/blynk/server/core/protocol/enums/Response.java#L12).
[Possible command codes](https://github.com/Peterkn2001/blynk-server/blob/master/server/core/src/main/java/cc/blynk/server/core/protocol/enums/Command.java#L12)
Message Id and Length are [big endian](http://en.wikipedia.org/wiki/Endianness#Big-endian).
Body has a command-specific format.
## Licensing
[GNU GPL license](https://github.com/Peterkn2001/blynk-server/blob/master/license.txt)
================================================
FILE: apiary.apib
================================================
FORMAT: 1A
HOST: http://blynk-cloud.com/
# Blynk HTTP RESTful API
Blynk HTTP RESTful API allows to easily read and write values to/from Pins in Blynk apps and Hardware (microcontrollers and microcomputers like Arduino, Raspberry Pi, ESP8266, Particle, etc.).
Every ```PUT``` request will update Pin's state both in apps and on the hardware.
Every ```GET``` request will return current state/value on the given Pin.
We also provide simplified API so you can do updates via GET requests.
## Get pin value [/{auth_token}/get/{pin}]
+ Parameters
+ auth_token (required, string, `4ae3851817194e2596cf1b7103603ef8`) ... authentification token.
+ pin (required, string, `D8`) ... pin you want to read.
### Get pin value [GET]
+ Response 200 (application/json)
[
]
+ Response 200 (application/json)
[
"1"
]
+ Response 200 (application/json)
[
"1",
"2"
]
+ Response 400 (plain/text)
Invalid token.
+ Response 400 (plain/text)
Wrong pin format.
+ Response 400 (plain/text)
Requested pin not exists in app.
## Write pin value via GET [/{auth_token}/update/{pin}?value={value}]
+ Parameters
+ auth_token (required, string, `4ae3851817194e2596cf1b7103603ef8`) ... authentification token.
+ pin (required, string, `D8`) ... pin you want to write.
+ value (required, string, `1`) ... pin value you want to write.
### Write pin value via GET [GET]
+ Response 200
+ Response 400 (plain/text)
Invalid token.
+ Response 400 (plain/text)
Wrong pin format.
+ Response 400 (plain/text)
Requested pin doesn't exist in the app.
+ Response 500 (plain/text)
Unexpected content type. Expecting application/json.
## Write pin value via PUT [/{auth_token}/update/{pin}]
+ Parameters
+ auth_token (required, string, `4ae3851817194e2596cf1b7103603ef8`) ... authentification token.
+ pin (required, string, `D8`) ... pin you want to write.
### Write pin value via PUT [PUT]
+ Request (application/json)
[
"1"
]
+ Request (application/json)
[
"1",
"2"
]
+ Response 200
+ Response 400 (plain/text)
Invalid token.
+ Response 400 (plain/text)
Wrong pin format.
+ Response 400 (plain/text)
Requested pin not exists in app.
+ Response 500 (plain/text)
Unexpected content type. Expecting application/json.
## Set Widget Property via GET [/{auth_token}/update/{pin}?{property}={value}]
+ Parameters
+ auth_token (required, string, `4ae3851817194e2596cf1b7103603ef8`) ... authentification token.
+ pin (required, string, `V0`) ... pin you want to write.
+ property (required, string, `label`) ... property you want to change `label`, `color`, etc. For reserved characters
like space and '#' for color property you need to use appropriate encoding. For example `#23C48E` should be passed as
`%2323C48E` where %23 is encoded '#' character.
+ value (required, string, `MyNewLabel`) ... property value.
### Set Widget Property via GET [GET]
+ Response 200
+ Response 400 (plain/text)
Invalid token.
+ Response 400 (plain/text)
Wrong pin format.
+ Response 400 (plain/text)
Requested pin not exists in app.
+ Response 500 (plain/text)
Unexpected content type. Expecting application/json.
## Hardware network status [/{auth_token}/isHardwareConnected]
+ Parameters
+ auth_token (required, string, `4ae3851817194e2596cf1b7103603ef8`) ... authentification token.
### Checks that hardware with provided token is online and connected to server [GET]
+ Response 200 (application/json)
true
+ Response 200 (application/json)
false
+ Response 400 (plain/text)
Invalid token.
## Application network status [/{auth_token}/isAppConnected]
### Check that application is connected to server and has active project with provided token [GET]
+ Response 200 (application/json)
true
+ Response 200 (application/json)
false
+ Response 400 (plain/text)
Invalid token.
## Send push notification [/{auth_token}/notify]
+ Parameters
+ auth_token (required, string, `4ae3851817194e2596cf1b7103603ef8`) ... authentification token.
### Notify [POST]
+ Request (application/json)
{
"body" : "message no less than 255 chars."
}
+ Response 200
+ Response 400 (plain/text)
Invalid token.
+ Response 400
Body is empty or larger than 255 chars.
+ Response 400
Project is not active.
+ Response 400
No notification widget or widget not initialized.
+ Response 500 (plain/text)
Unexpected content type. Expecting application/json.
## Send email [/{auth_token}/email]
+ Parameters
+ auth_token (required, string, `4ae3851817194e2596cf1b7103603ef8`) ... authentification token.
### Email [POST]
+ Request (application/json)
{
"to" : "email",
"title" : "title",
"subj" : "subj"
}
+ Response 200
+ Response 400 (plain/text)
Invalid token.
+ Response 400
Email body is wrong. Missing or empty fields 'to', 'subj'.
+ Response 400
Project is not active.
+ Response 400
No email widget.
+ Response 500 (plain/text)
Unexpected content type. Expecting application/json.
### Pin history data [/{auth_token}/data/{pin}]
+ Parameters
+ auth_token (required, string, `4ae3851817194e2596cf1b7103603ef8`) ... authentification token.
+ pin (required, string, `D8`) ... pin you want to read.
## Get all history data for specific pin [GET]
+ Response 200 (application/x-gzip)
### QR for project cloning [/{auth_token}/qr]
+ Parameters
+ auth_token (required, string, `4ae3851817194e2596cf1b7103603ef8`) ... authentification token.
## QR for project cloning [GET]
+ Response 200 (image/png)
## Get project [/{auth_token}/project]
Returns project connected with provided token.
+ Parameters
+ auth_token (required, string, `4ae3851817194e2596cf1b7103603ef8`) ... authentification token.
### Get project [GET]
+ Response 200 (application/json)
{
"id":125564119,
"name":"New Project",
"createdAt":0,
"updatedAt":0,
"widgets":[
{
"type":"TWO_AXIS_JOYSTICK",
"id":1036300912,
"x":0,
"y":4,
"color":-308477697,
"width":5,
"height":4,
"pins":[
{
"pin":15,
"pwmMode":false,
"rangeMappingOn":false,
"pinType":"ANALOG",
"value":"1",
"min":0,
"max":255
},
{
"pin":15,
"pwmMode":false,
"rangeMappingOn":false,
"pinType":"ANALOG",
"value":"2",
"min":0,
"max":255
}
],
"split":true,
"autoReturnOn":true,
"portraitLocked":false
},
{
"type":"BUTTON",
"id":1036300899,
"x":5,
"y":0,
"color":616861439,
"width":2,
"height":2,
"pinType":"DIGITAL",
"pin":8,
"pwmMode":false,
"rangeMappingOn":false,
"min":0,
"max":0,
"value":"0",
"pushMode":true
},
{
"type":"LED",
"id":1036300908,
"x":4,
"y":0,
"color":1602017535,
"width":1,
"height":1,
"label":"gggg",
"pin":-1,
"pwmMode":false,
"rangeMappingOn":false,
"min":0,
"max":0,
"frequency":0
},
{
"type":"LED",
"id":1036300904,
"x":7,
"y":0,
"color":1602017535,
"width":1,
"height":1,
"pinType":"VIRTUAL",
"pin":2,
"pwmMode":false,
"rangeMappingOn":false,
"min":0,
"max":0,
"frequency":0
},
{
"type":"TIMER",
"id":276297114,
"x":0,
"y":1,
"color":-308477697,
"width":3,
"height":1,
"pinType":"DIGITAL",
"pin":0,
"pwmMode":false,
"rangeMappingOn":false,
"min":0,
"max":0,
"startTime":75600,
"startValue":"dw\u00000\u00001",
"stopTime":75599,
"stopValue":"dw\u00000\u00000"
},
{
"type":"LED",
"id":1036300903,
"x":4,
"y":1,
"color":1602017535,
"width":1,
"height":1,
"pinType":"VIRTUAL",
"pin":1,
"pwmMode":false,
"rangeMappingOn":false,
"min":0,
"max":0,
"frequency":0
},
{
"type":"SLIDER",
"id":1036300911,
"x":0,
"y":0,
"color":-308477697,
"width":4,
"height":1,
"pinType":"DIGITAL",
"pin":3,
"pwmMode":true,
"rangeMappingOn":false,
"min":0,
"max":255,
"value":"87"
},
{
"type":"LED",
"id":1036300902,
"x":3,
"y":1,
"color":1602017535,
"width":1,
"height":1,
"pinType":"VIRTUAL",
"pin":0,
"pwmMode":false,
"rangeMappingOn":false,
"min":0,
"max":0,
"frequency":0
},
{
"type":"DIGIT4_DISPLAY",
"id":1036300913,
"x":5,
"y":4,
"color":-308477697,
"width":2,
"height":1,
"pinType":"ANALOG",
"pin":14,
"pwmMode":false,
"rangeMappingOn":false,
"min":0,
"max":1023,
"frequency":1000
},
{
"type":"BUTTON",
"id":1036300914,
"x":5,
"y":5,
"color":616861439,
"width":2,
"height":2,
"pinType":"DIGITAL",
"pin":1,
"pwmMode":false,
"rangeMappingOn":false,
"min":0,
"max":0,
"value":"1",
"pushMode":false
},
{
"type":"NOTIFICATION",
"id":1036300915,
"x":5,
"y":7,
"width":2,
"height":1,
"androidTokens":{
"uid":"token"
},
"notifyWhenOffline":false,
"priority":"normal"
},
{
"type":"EMAIL",
"id":1036300916,
"x":5,
"y":9,
"width":2,
"height":1
}
],
"boardType":"Arduino UNO",
"keepScreenOn":false,
"isShared":false,
"isActive":true
}
+ Response 400 (plain/text)
Invalid token.
================================================
FILE: checkstyle.xml
================================================
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://checkstyle.sourceforge.net/dtds/configuration_1_3.dtd">
<!--
Checkstyle configuration that checks the sun coding conventions from:
- the Java Language Specification at
http://java.sun.com/docs/books/jls/second_edition/html/index.html
- the Sun Code Conventions at http://java.sun.com/docs/codeconv/
- the Javadoc guidelines at
http://java.sun.com/j2se/javadoc/writingdoccomments/index.html
- the JDK Api documentation http://java.sun.com/j2se/docs/api/index.html
- some best practices
Checkstyle is very configurable. Be sure to read the documentation at
http://checkstyle.sf.net (or in your downloaded distribution).
Most Checks are configurable, be sure to consult the documentation.
To completely disable a check, just comment it out or delete it from the file.
Finally, it is worth reading the documentation.
-->
<module name="Checker">
<!--
If you set the basedir property below, then all reported file
names will be relative to the specified directory. See
http://checkstyle.sourceforge.net/5.x/config.html#Checker
<property name="basedir" value="${basedir}"/>
-->
<property name="fileExtensions" value="java"/>
<!-- Checks that a package-info.java file exists for each package. -->
<!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocPackage -->
<!-- todo fix? -->
<!-- <module name="JavadocPackage"/> -->
<!-- Checks whether files end with a new line. -->
<!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
<module name="NewlineAtEndOfFile"/>
<!-- Checks that property files contain the same keys. -->
<!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
<module name="Translation"/>
<!-- Checks for Size Violations. -->
<!-- See http://checkstyle.sf.net/config_sizes.html -->
<module name="FileLength"/>
<!-- Checks for whitespace -->
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
<module name="FileTabCharacter"/>
<!-- Miscellaneous other checks. -->
<!-- See http://checkstyle.sf.net/config_misc.html -->
<module name="RegexpSingleline">
<property name="format" value="\s+$"/>
<property name="minimum" value="0"/>
<property name="maximum" value="0"/>
<property name="message" value="Line has trailing spaces."/>
</module>
<!-- Checks for Headers -->
<!-- See http://checkstyle.sf.net/config_header.html -->
<!-- <module name="Header"> -->
<!-- <property name="headerFile" value="${checkstyle.header.file}"/> -->
<!-- <property name="fileExtensions" value="java"/> -->
<!-- </module> -->
<module name="TreeWalker">
<!-- Checks for Javadoc comments. -->
<!-- See http://checkstyle.sf.net/config_javadoc.html
<module name="JavadocMethod"/>
<module name="JavadocType"/>
<module name="JavadocVariable"/>
<module name="JavadocStyle"/>
-->
<!-- Checks for Naming Conventions. -->
<!-- See http://checkstyle.sf.net/config_naming.html -->
<!--
<module name="ConstantName">
<property name="format"
value="^log?|[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"/>
</module>
-->
<module name="LocalFinalVariableName"/>
<module name="LocalVariableName"/>
<module name="MemberName"/>
<module name="MethodName"/>
<module name="PackageName"/>
<module name="ParameterName"/>
<!--
<module name="StaticVariableName"/>
-->
<module name="TypeName"/>
<!-- Checks for imports -->
<!-- See http://checkstyle.sf.net/config_import.html -->
<module name="AvoidStarImport"/>
<!--<module name="IllegalImport"/> defaults to sun.* packages -->
<module name="RedundantImport"/>
<module name="UnusedImports">
<property name="processJavadoc" value="false"/>
</module>
<!-- Checks for Size Violations. -->
<!-- See http://checkstyle.sf.net/config_sizes.html -->
<module name="LineLength">
<property name="max" value="120"/>
</module>
<module name="MethodLength">
<property name="max" value="250"/>
</module>
<!--
<module name="ParameterNumber"/>
-->
<!-- Checks for whitespace -->
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
<module name="EmptyForIteratorPad"/>
<module name="GenericWhitespace"/>
<module name="MethodParamPad"/>
<module name="NoWhitespaceAfter"/>
<module name="NoWhitespaceBefore"/>
<module name="OperatorWrap"/>
<module name="ParenPad"/>
<module name="TypecastParenPad"/>
<module name="WhitespaceAfter"/>
<module name="WhitespaceAround"/>
<!-- Modifier Checks -->
<!-- See http://checkstyle.sf.net/config_modifiers.html
<module name="ModifierOrder"/>
-->
<module name="RedundantModifier"/>
<!-- Checks for blocks. You know, those {}'s -->
<!-- See http://checkstyle.sf.net/config_blocks.html -->
<module name="AvoidNestedBlocks"/>
<module name="EmptyBlock"/>
<module name="LeftCurly"/>
<module name="NeedBraces"/>
<module name="RightCurly"/>
<!-- Checks for common coding problems -->
<!-- See http://checkstyle.sf.net/config_coding.html -->
<!--
<module name="AvoidInlineConditionals"/>
-->
<module name="EmptyStatement"/>
<module name="EqualsHashCode"/>
<module name="IllegalInstantiation"/>
<!--
<module name="HiddenField"/>
<module name="InnerAssignment"/>
<module name="MagicNumber">
<property name="ignoreNumbers" value="0, 1, 31"/>
</module>
<module name="MissingSwitchDefault"/>
<module name="SimplifyBooleanReturn"/>
-->
<module name="SimplifyBooleanExpression"/>
<module name="FinalClass"/>
<!-- Checks for class design -->
<!-- See http://checkstyle.sf.net/config_design.html -->
<!--
<module name="DesignForExtension"/>
<module name="VisibilityModifier"/>
-->
<module name="InterfaceIsType"/>
<module name="HideUtilityClassConstructor"/>
<!-- Miscellaneous other checks. -->
<!-- See http://checkstyle.sf.net/config_misc.html -->
<module name="ArrayTypeStyle"/>
<module name="TodoComment"/>
<module name="UpperEll"/>
</module>
</module>
================================================
FILE: client/README.md
================================================
## App Client (emulates Smartphone App)
+ To emulate the Smartphone App client:
java -jar client-${PUT_LATEST_VERSION_HERE}.jar -mode app -host localhost -port 9443
+ In this client: register new user and/or login with the same credentials
register username@example.com UserPassword
login username@example.com UserPassword
+ Save profile with simple dashboard
createDash {"id":1, "name":"My Dashboard", "boardType":"UNO"}
+ Get the Auth Token for hardware (e.g Arduino)
getToken 1
+ Activate dashboard
activate 1
+ You will get server response similar to this:
00:05:18.100 TRACE - Incomming : GetTokenMessage{id=30825, command=GET_TOKEN, length=32, body='33bcbe756b994a6768494d55d1543c74'}
Where `33bcbe756b994a6768494d55d1543c74` is your Auth Token.
## Hardware Client (emulates Hardware)
+ Start new client and use received Auth Token to login
java -jar client-${PUT_LATEST_VERSION_HERE}.jar -mode hardware -host localhost -port 8442
login 33bcbe756b994a6768494d55d1543c74
You can run as many clients as you want. You have only 15 seconds for login until your client will be disconnected from server,
so hurry up :).
Clients with the same credentials and Auth Token are grouped into one Session and can send messages to each other.
All client’s commands are human-friendly, so you don't have to remember the codes.
## Hardware Commands
List of hardware commands:
+ Digital write:
hardware dw 9 1
hardware dw 9 0
+ Digital read:
hardware dr 9
You should receive response: dw 9 <val>
+ Analog write:
hardware aw 14 123
+ Analog read:
hardware ar 14
You should receive response: aw 14 <val>
+ Virtual write:
hardware vw 9 1234
hardware vw 9 string
hardware vw 9 item1 item2 item3
hardware vw 9 key1 val1 key2 val2
+ Virtual read:
hardware vr 9
You should receive response: vw 9 <values>
================================================
FILE: client/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>blynk</artifactId>
<groupId>cc.blynk</groupId>
<version>0.41.17-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>client</artifactId>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>${maven-shade-plugin.version}</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<finalName>client-${project.version}</finalName>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>cc.blynk.client.ClientLauncher</Main-Class>
<Build-Number>${project.version}</Build-Number>
<Build-By>Blynk Inc.</Build-By>
</manifestEntries>
</transformer>
</transformers>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/maven/**</exclude>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>cc.blynk.server</groupId>
<artifactId>core</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>
================================================
FILE: client/src/main/java/cc/blynk/client/ClientLauncher.java
================================================
package cc.blynk.client;
import cc.blynk.client.core.ActiveHardwareClient;
import cc.blynk.client.core.AppClient;
import cc.blynk.client.core.HardwareClient;
import cc.blynk.client.enums.ClientMode;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.DefaultParser;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
/**
* The Blynk Project.
* Created by Dmitriy Dumanskiy.
* Created on 11.03.15.
*/
public final class ClientLauncher {
static final String DEFAULT_HOST = "localhost";
static final int DEFAULT_HARDWARE_PORT = 8080;
static final int DEFAULT_APPLICATION_PORT = 9443;
private static final Options options = new Options();
static {
options.addOption("host", true, "Server host or ip.")
.addOption("port", true, "Port client should connect to.")
.addOption("mode", true, "Client mode. 'hardware' or 'app'.")
.addOption("tokens", true, "Tokens");
}
private ClientLauncher() {
}
public static void main(String[] args) throws ParseException {
CommandLine cmd = new DefaultParser().parse(options, args);
ClientMode mode = ClientMode.parse(cmd.getOptionValue("mode", ClientMode.HARDWARE.name()));
String host = cmd.getOptionValue("host", DEFAULT_HOST);
int port = Integer.parseInt(cmd.getOptionValue("port",
(mode == ClientMode.APP
? String.valueOf(DEFAULT_APPLICATION_PORT)
: String.valueOf(DEFAULT_HARDWARE_PORT)))
);
switch (mode) {
case APP :
new AppClient(host, port).start(new BufferedReader(new InputStreamReader(System.in)));
break;
case HARDWARE :
new HardwareClient(host, port).start(new BufferedReader(new InputStreamReader(System.in)));
break;
default :
String tokensFullString = cmd.getOptionValue("tokens");
if (tokensFullString == null) {
throw new RuntimeException("Tokens required for TEST mode.");
}
String[] tokens = tokensFullString.split(",");
for (String token : tokens) {
new ActiveHardwareClient(host, port).start(token);
}
}
}
}
================================================
FILE: client/src/main/java/cc/blynk/client/CommandParserUtil.java
================================================
package cc.blynk.client;
import static cc.blynk.server.core.protocol.enums.Command.ACTIVATE_DASHBOARD;
import static cc.blynk.server.core.protocol.enums.Command.ADD_ENERGY;
import static cc.blynk.server.core.protocol.enums.Command.ADD_PUSH_TOKEN;
import static cc.blynk.server.core.protocol.enums.Command.APP_SYNC;
import static cc.blynk.server.core.protocol.enums.Command.ASSIGN_TOKEN;
import static cc.blynk.server.core.protocol.enums.Command.BLYNK_INTERNAL;
import static cc.blynk.server.core.protocol.enums.Command.BRIDGE;
import static cc.blynk.server.core.protocol.enums.Command.CREATE_APP;
import static cc.blynk.server.core.protocol.enums.Command.CREATE_DASH;
import static cc.blynk.server.core.protocol.enums.Command.CREATE_DEVICE;
import static cc.blynk.server.core.protocol.enums.Command.CREATE_REPORT;
import static cc.blynk.server.core.protocol.enums.Command.CREATE_TAG;
import static cc.blynk.server.core.protocol.enums.Command.CREATE_TILE_TEMPLATE;
import static cc.blynk.server.core.protocol.enums.Command.CREATE_WIDGET;
import static cc.blynk.server.core.protocol.enums.Command.DEACTIVATE_DASHBOARD;
import static cc.blynk.server.core.protocol.enums.Command.DELETE_APP;
import static cc.blynk.server.core.protocol.enums.Command.DELETE_DASH;
import static cc.blynk.server.core.protocol.enums.Command.DELETE_DEVICE;
import static cc.blynk.server.core.protocol.enums.Command.DELETE_DEVICE_DATA;
import static cc.blynk.server.core.protocol.enums.Command.DELETE_ENHANCED_GRAPH_DATA;
import static cc.blynk.server.core.protocol.enums.Command.DELETE_REPORT;
import static cc.blynk.server.core.protocol.enums.Command.DELETE_TAG;
import static cc.blynk.server.core.protocol.enums.Command.DELETE_TILE_TEMPLATE;
import static cc.blynk.server.core.protocol.enums.Command.DELETE_WIDGET;
import static cc.blynk.server.core.protocol.enums.Command.EMAIL;
import static cc.blynk.server.core.protocol.enums.Command.EMAIL_QR;
import static cc.blynk.server.core.protocol.enums.Command.EXPORT_GRAPH_DATA;
import static cc.blynk.server.core.protocol.enums.Command.EXPORT_REPORT;
import static cc.blynk.server.core.protocol.enums.Command.GET_CLONE_CODE;
import static cc.blynk.server.core.protocol.enums.Command.GET_DEVICES;
import static cc.blynk.server.core.protocol.enums.Command.GET_ENERGY;
import static cc.blynk.server.core.protocol.enums.Command.GET_ENHANCED_GRAPH_DATA;
import static cc.blynk.server.core.protocol.enums.Command.GET_PROJECT_BY_CLONE_CODE;
import static cc.blynk.server.core.protocol.enums.Command.GET_PROJECT_BY_TOKEN;
import static cc.blynk.server.core.protocol.enums.Command.GET_PROVISION_TOKEN;
import static cc.blynk.server.core.protocol.enums.Command.GET_SERVER;
import static cc.blynk.server.core.protocol.enums.Command.GET_SHARE_TOKEN;
import static cc.blynk.server.core.protocol.enums.Command.GET_TAGS;
import static cc.blynk.server.core.protocol.enums.Command.GET_WIDGET;
import static cc.blynk.server.core.protocol.enums.Command.HARDWARE;
import static cc.blynk.server.core.protocol.enums.Command.HARDWARE_LOGIN;
import static cc.blynk.server.core.protocol.enums.Command.HARDWARE_RESEND_FROM_BLUETOOTH;
import static cc.blynk.server.core.protocol.enums.Command.HARDWARE_SYNC;
import static cc.blynk.server.core.protocol.enums.Command.LOAD_PROFILE_GZIPPED;
import static cc.blynk.server.core.protocol.enums.Command.LOGIN;
import static cc.blynk.server.core.protocol.enums.Command.LOGOUT;
import static cc.blynk.server.core.protocol.enums.Command.MOBILE_GET_DEVICE;
import static cc.blynk.server.core.protocol.enums.Command.PING;
import static cc.blynk.server.core.protocol.enums.Command.PUSH_NOTIFICATION;
import static cc.blynk.server.core.protocol.enums.Command.REFRESH_SHARE_TOKEN;
import static cc.blynk.server.core.protocol.enums.Command.REFRESH_TOKEN;
import static cc.blynk.server.core.protocol.enums.Command.REGISTER;
import static cc.blynk.server.core.protocol.enums.Command.RESET_PASSWORD;
import static cc.blynk.server.core.protocol.enums.Command.RESOLVE_EVENT;
import static cc.blynk.server.core.protocol.enums.Command.SET_WIDGET_PROPERTY;
import static cc.blynk.server.core.protocol.enums.Command.SHARE_LOGIN;
import static cc.blynk.server.core.protocol.enums.Command.SHARING;
import static cc.blynk.server.core.protocol.enums.Command.SMS;
import static cc.blynk.server.core.protocol.enums.Command.TWEET;
import static cc.blynk.server.core.protocol.enums.Command.UPDATE_APP;
import static cc.blynk.server.core.protocol.enums.Command.UPDATE_DASH;
import static cc.blynk.server.core.protocol.enums.Command.UPDATE_DEVICE;
import static cc.blynk.server.core.protocol.enums.Command.UPDATE_FACE;
import static cc.blynk.server.core.protocol.enums.Command.UPDATE_PROJECT_SETTINGS;
import static cc.blynk.server.core.protocol.enums.Command.UPDATE_REPORT;
import static cc.blynk.server.core.protocol.enums.Command.UPDATE_TAG;
import static cc.blynk.server.core.protocol.enums.Command.UPDATE_TILE_TEMPLATE;
import static cc.blynk.server.core.protocol.enums.Command.UPDATE_WIDGET;
/**
* The Blynk Project.
* Created by Dmitriy Dumanskiy.
* Created on 2/1/2015.
*
* Convertor between user-friendly command and protocol command code
*/
public final class CommandParserUtil {
private CommandParserUtil() {
}
public static Short parseCommand(String stringCommand) {
switch (stringCommand.toLowerCase()) {
case "hardware" :
return HARDWARE;
case "hardwarebt" :
return HARDWARE_RESEND_FROM_BLUETOOTH;
case "ping" :
return PING;
case "loadprofilegzipped" :
return LOAD_PROFILE_GZIPPED;
case "appsync" :
return APP_SYNC;
case "sharing" :
return SHARING;
case "assigntoken" :
return ASSIGN_TOKEN;
case "refreshtoken" :
return REFRESH_TOKEN;
case "login" :
return LOGIN;
case "hardwarelogin" :
return HARDWARE_LOGIN;
case "logout" :
return LOGOUT;
case "getenhanceddata" :
return GET_ENHANCED_GRAPH_DATA;
case "deleteenhanceddata" :
return DELETE_ENHANCED_GRAPH_DATA;
case "export" :
return EXPORT_GRAPH_DATA;
case "activate" :
return ACTIVATE_DASHBOARD;
case "deactivate" :
return DEACTIVATE_DASHBOARD;
case "register" :
return REGISTER;
case "setproperty" :
return SET_WIDGET_PROPERTY;
case "tweet" :
return TWEET;
case "email" :
return EMAIL;
case "push" :
return PUSH_NOTIFICATION;
case "sms" :
return SMS;
case "addpushtoken" :
return ADD_PUSH_TOKEN;
case "bridge" :
return BRIDGE;
case "createdash" :
return CREATE_DASH;
case "updatedash" :
return UPDATE_DASH;
case "deletedash" :
return DELETE_DASH;
case "updatesettings" :
return UPDATE_PROJECT_SETTINGS;
case "createwidget" :
return CREATE_WIDGET;
case "updatewidget" :
return UPDATE_WIDGET;
case "deletewidget" :
return DELETE_WIDGET;
case "getwidget" :
return GET_WIDGET;
case "hardsync" :
return HARDWARE_SYNC;
case "internal" :
return BLYNK_INTERNAL;
case "createtemplate" :
return CREATE_TILE_TEMPLATE;
case "updatetemplate" :
return UPDATE_TILE_TEMPLATE;
case "deletetemplate" :
return DELETE_TILE_TEMPLATE;
case "createdevice" :
return CREATE_DEVICE;
case "updatedevice" :
return UPDATE_DEVICE;
case "deletedevice" :
return DELETE_DEVICE;
case "getdevices" :
return GET_DEVICES;
case "getdevice" :
return MOBILE_GET_DEVICE;
case "createtag" :
return CREATE_TAG;
case "updatetag" :
return UPDATE_TAG;
case "deletetag" :
return DELETE_TAG;
case "gettags" :
return GET_TAGS;
case "addenergy" :
return ADD_ENERGY;
case "getenergy" :
return GET_ENERGY;
case "getserver" :
return GET_SERVER;
//sharing section
case "sharelogin" :
return SHARE_LOGIN;
case "getsharetoken" :
return GET_SHARE_TOKEN;
case "refreshsharetoken" :
return REFRESH_SHARE_TOKEN;
case "createapp" :
return CREATE_APP;
case "updateapp" :
return UPDATE_APP;
case "deleteapp" :
return DELETE_APP;
case "getprojectbytoken" :
return GET_PROJECT_BY_TOKEN;
case "emailqr" :
return EMAIL_QR;
case "updateface" :
return UPDATE_FACE;
case "getclonecode" :
return GET_CLONE_CODE;
case "getprojectbyclonecode" :
return GET_PROJECT_BY_CLONE_CODE;
case "getprovisiontoken" :
return GET_PROVISION_TOKEN;
case "resolveevent" :
return RESOLVE_EVENT;
case "deletedevicedata" :
return DELETE_DEVICE_DATA;
case "createreport" :
return CREATE_REPORT;
case "deletereport" :
return DELETE_REPORT;
case "updatereport" :
return UPDATE_REPORT;
case "exportreport" :
return EXPORT_REPORT;
case "resetpass" :
return RESET_PASSWORD;
default:
throw new IllegalArgumentException("Unsupported command");
}
}
}
================================================
FILE: client/src/main/java/cc/blynk/client/core/ActiveHardwareClient.java
================================================
package cc.blynk.client.core;
import cc.blynk.client.handlers.ClientReplayingMessageDecoder;
import cc.blynk.client.handlers.hardware.HardwareEchoHandler;
import cc.blynk.server.core.protocol.handlers.encoders.MessageEncoder;
import cc.blynk.server.core.protocol.model.messages.StringMessage;
import cc.blynk.server.core.protocol.model.messages.common.HardwareMessage;
import cc.blynk.server.core.stats.GlobalStats;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;
import java.util.Random;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.TimeUnit;
import static cc.blynk.server.core.protocol.enums.Command.PING;
/**
* The Blynk Project.
* Created by Dmitriy Dumanskiy.
* Created on 11.03.15.
*/
public class ActiveHardwareClient extends BaseClient {
private int buttonVal = 1;
private int ledVal = 20;
public ActiveHardwareClient(String host, int port) {
super(host, port, new Random());
log.info("Creating hardware client. Host : {}, port : {}", host, port);
//pinging for hardware client to avoid closing from server side for inactivity
nioEventLoopGroup.scheduleAtFixedRate(() -> send(new StringMessage(777, PING, "")), 12, 12, TimeUnit.SECONDS);
}
private static HardwareMessage makeCommand(String body) {
return new HardwareMessage(778, (body.replaceAll(" ", "\0")));
}
@Override
public ChannelInitializer<SocketChannel> getChannelInitializer() {
return new ChannelInitializer<>() {
@Override
public void initChannel(SocketChannel ch) {
ChannelPipeline pipeline = ch.pipeline();
pipeline.addLast(new ClientReplayingMessageDecoder());
pipeline.addLast(new MessageEncoder(new GlobalStats()));
pipeline.addLast(new HardwareEchoHandler());
}
};
}
public void start(String token) {
super.start();
send("login " + token);
nioEventLoopGroup.scheduleAtFixedRate(() -> {
send(makeCommand("vw 4 " + ThreadLocalRandom.current().nextInt(100)));
send(makeCommand("dw 3 " + ThreadLocalRandom.current().nextInt(255)));
send(makeCommand("dw 0 " + buttonVal));
send(makeCommand("vw 5 " + (buttonVal == 1 ? 255 : 0)));
send(makeCommand("vw 6 " + ledVal));
send(makeCommand("aw 6 " + ledVal));
send(makeCommand("vw 10 p 0 0 ledVal:" + ledVal));
if (buttonVal == 1) {
buttonVal = 0;
} else {
buttonVal = 1;
}
if (ledVal > 255) {
ledVal = 0;
send(makeCommand("vw 10 clr"));
} else {
ledVal += 20;
}
}, 1, 1, TimeUnit.SECONDS);
}
public void send(String line) {
send(produceMessageBaseOnUserInput(line, 1));
}
}
================================================
FILE: client/src/main/java/cc/blynk/client/core/AppClient.java
================================================
package cc.blynk.client.core;
import cc.blynk.client.handlers.ClientReplayingMessageDecoder;
import cc.blynk.server.core.protocol.handlers.encoders.MessageEncoder;
import cc.blynk.server.core.stats.GlobalStats;
import cc.blynk.utils.properties.ServerProperties;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.ssl.SslContext;
import io.netty.handler.ssl.SslContextBuilder;
import io.netty.handler.ssl.SslProvider;
import io.netty.handler.ssl.util.InsecureTrustManagerFactory;
import javax.net.ssl.SSLException;
import java.io.File;
import java.util.Random;
/**
* The Blynk Project.
* Created by Dmitriy Dumanskiy.
* Created on 11.03.15.
*/
public class AppClient extends BaseClient {
protected SslContext sslCtx;
public AppClient(String host, int port) {
super(host, port, new Random());
}
protected AppClient(String host, int port, Random msgIdGenerator, ServerProperties properties) {
super(host, port, msgIdGenerator, properties);
log.info("Creating app client. Host {}, sslPort : {}", host, port);
File serverCert = makeCertificateFile("server.ssl.cert");
File clientCert = makeCertificateFile("client.ssl.cert");
File clientKey = makeCertificateFile("client.ssl.key");
try {
if (!serverCert.exists() || !clientCert.exists() || !clientKey.exists()) {
log.info("Enabling one-way auth with no certs checks.");
this.sslCtx = SslContextBuilder.forClient().sslProvider(SslProvider.JDK)
.trustManager(InsecureTrustManagerFactory.INSTANCE)
.build();
} else {
log.info("Enabling mutual auth.");
String clientPass = props.getProperty("client.ssl.key.pass");
this.sslCtx = SslContextBuilder.forClient()
.sslProvider(SslProvider.JDK)
.trustManager(serverCert)
.keyManager(clientCert, clientKey, clientPass)
.build();
}
} catch (SSLException e) {
log.error("Error initializing SSL context. Reason : {}", e.getMessage());
log.debug(e);
throw new RuntimeException(e);
}
}
@Override
public ChannelInitializer<SocketChannel> getChannelInitializer() {
return new ChannelInitializer<>() {
@Override
public void initChannel(SocketChannel ch) {
ChannelPipeline pipeline = ch.pipeline();
if (sslCtx != null) {
pipeline.addLast(sslCtx.newHandler(ch.alloc(), host, port));
}
pipeline.addLast(new ClientReplayingMessageDecoder());
pipeline.addLast(new MessageEncoder(new GlobalStats()));
}
};
}
}
================================================
FILE: client/src/main/java/cc/blynk/client/core/BaseClient.java
================================================
package cc.blynk.client.core;
import cc.blynk.client.CommandParserUtil;
import cc.blynk.server.core.protocol.model.messages.MessageBase;
import cc.blynk.utils.properties.ServerProperties;
import io.netty.bootstrap.Bootstrap;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelOption;
import io.netty.channel.ConnectTimeoutException;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.SocketChannel;
import io.netty.channel.socket.nio.NioSocketChannel;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.nio.channels.UnresolvedAddressException;
import java.util.Collections;
import java.util.Random;
import static cc.blynk.server.core.protocol.enums.Command.BRIDGE;
import static cc.blynk.server.core.protocol.enums.Command.DELETE_WIDGET;
import static cc.blynk.server.core.protocol.enums.Command.EMAIL;
import static cc.blynk.server.core.protocol.enums.Command.EXPORT_GRAPH_DATA;
import static cc.blynk.server.core.protocol.enums.Command.HARDWARE;
import static cc.blynk.server.core.protocol.enums.Command.HARDWARE_RESEND_FROM_BLUETOOTH;
import static cc.blynk.server.core.protocol.enums.Command.HARDWARE_SYNC;
import static cc.blynk.server.core.protocol.enums.Command.LOAD_PROFILE_GZIPPED;
import static cc.blynk.server.core.protocol.enums.Command.RESET_PASSWORD;
import static cc.blynk.server.core.protocol.enums.Command.SET_WIDGET_PROPERTY;
import static cc.blynk.server.core.protocol.enums.Command.SHARE_LOGIN;
import static cc.blynk.server.core.protocol.enums.Command.SHARING;
import static cc.blynk.server.core.protocol.model.messages.MessageFactory.produce;
/**
* The Blynk Project.
* Created by Dmitriy Dumanskiy.
* Created on 1/31/2015.
*/
public abstract class BaseClient {
protected static final Logger log = LogManager.getLogger(BaseClient.class);
protected final ServerProperties props;
protected final String host;
protected final int port;
protected final Random random;
protected Channel channel;
protected NioEventLoopGroup nioEventLoopGroup;
public BaseClient(String host, int port, Random messageIdGenerator) {
this(host, port, messageIdGenerator, new NioEventLoopGroup(1));
}
public BaseClient(String host, int port, Random messageIdGenerator, ServerProperties serverProperties) {
this.host = host;
this.port = port;
this.random = messageIdGenerator;
this.props = serverProperties;
this.nioEventLoopGroup = new NioEventLoopGroup(1);
}
public BaseClient(String host, int port, Random messageIdGenerator, NioEventLoopGroup nioEventLoopGroup) {
this.host = host;
this.port = port;
this.random = messageIdGenerator;
this.props = new ServerProperties(Collections.emptyMap());
this.nioEventLoopGroup = nioEventLoopGroup;
}
public static MessageBase produceMessageBaseOnUserInput(String line, int msgId) {
String[] input = line.split(" ", 2);
short command;
try {
command = CommandParserUtil.parseCommand(input[0]);
} catch (IllegalArgumentException e) {
log.error("Command not supported {}", input[0]);
return null;
}
String body = input.length == 1 ? "" : input[1];
if (command == HARDWARE
|| command == SHARE_LOGIN
|| command == LOAD_PROFILE_GZIPPED
|| command == HARDWARE_RESEND_FROM_BLUETOOTH
|| command == BRIDGE
|| command == EMAIL
|| command == SHARING
|| command == EXPORT_GRAPH_DATA
|| command == SET_WIDGET_PROPERTY
|| command == HARDWARE_SYNC
|| command == RESET_PASSWORD
|| command == DELETE_WIDGET) {
body = body.replace(" ", "\0");
}
return produce(msgId, command, body);
}
public void start(BufferedReader commandInputStream) {
this.nioEventLoopGroup = new NioEventLoopGroup(1);
try {
Bootstrap b = new Bootstrap();
b.group(nioEventLoopGroup)
.channel(NioSocketChannel.class)
.option(ChannelOption.SO_KEEPALIVE, true)
.handler(getChannelInitializer());
// Start the connection attempt.
this.channel = b.connect(host, port).sync().channel();
readUserInput(commandInputStream);
} catch (UnresolvedAddressException uae) {
log.error("Host name '{}' is invalid. Please make sure it is correct name.", host);
} catch (ConnectTimeoutException cte) {
log.error("Timeout exceeded when connecting to '{}:{}'. "
+ "Please make sure host available and port is open on target host.", host, port);
} catch (IOException | InterruptedException e) {
log.error("Error running client. Shutting down.", e);
} catch (Exception e) {
log.error(e);
} finally {
// The connection is closed automatically on shutdown.
nioEventLoopGroup.shutdownGracefully();
}
}
public void start() {
Bootstrap b = new Bootstrap();
b.group(nioEventLoopGroup).channel(NioSocketChannel.class).handler(getChannelInitializer());
try {
// Start the connection attempt.
this.channel = b.connect(host, port).sync().channel();
} catch (InterruptedException e) {
log.error(e);
}
}
protected File makeCertificateFile(String propertyName) {
String path = props.getProperty(propertyName);
if (path == null || path.isEmpty()) {
path = "";
}
File file = new File(path);
if (!file.exists()) {
log.warn("{} file was not found at {} location", propertyName, path);
}
return file;
}
protected abstract ChannelInitializer<SocketChannel> getChannelInitializer();
private void readUserInput(BufferedReader commandInputStream) throws IOException {
String line;
while ((line = commandInputStream.readLine()) != null) {
// If user typed the 'quit' command, wait until the server closes the connection.
if ("quit".equals(line.toLowerCase())) {
log.info("Got 'quit' command. Closing client.");
channel.close();
break;
}
MessageBase msg = produceMessageBaseOnUserInput(line, (short) random.nextInt(Short.MAX_VALUE));
if (msg == null) {
continue;
}
send(msg);
}
}
public void send(Object msg) {
channel.writeAndFlush(msg);
}
public boolean isClosed() {
return !channel.isOpen();
}
public ChannelFuture stop() {
if (nioEventLoopGroup.isTerminated()) {
return channel.voidPromise();
}
ChannelFuture channelFuture = channel.close().awaitUninterruptibly();
nioEventLoopGroup.shutdownGracefully();
return channelFuture;
}
}
================================================
FILE: client/src/main/java/cc/blynk/client/core/HardwareClient.java
================================================
package cc.blynk.client.core;
import cc.blynk.client.handlers.ClientReplayingMessageDecoder;
import cc.blynk.server.core.protocol.handlers.encoders.MessageEncoder;
import cc.blynk.server.core.protocol.model.messages.StringMessage;
import cc.blynk.server.core.stats.GlobalStats;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;
import java.util.Random;
import java.util.concurrent.TimeUnit;
import static cc.blynk.server.core.protocol.enums.Command.PING;
/**
* The Blynk Project.
* Created by Dmitriy Dumanskiy.
* Created on 11.03.15.
*/
public class HardwareClient extends BaseClient {
public HardwareClient(String host, int port) {
super(host, port, new Random());
log.info("Creating hardware client. Host : {}, port : {}", host, port);
//pinging for hardware client to avoid closing from server side for inactivity
nioEventLoopGroup.scheduleAtFixedRate(() -> send(new StringMessage(777, PING, "")), 12, 12, TimeUnit.SECONDS);
}
@Override
public ChannelInitializer<SocketChannel> getChannelInitializer() {
return new ChannelInitializer<>() {
@Override
public void initChannel(SocketChannel ch) {
ChannelPipeline pipeline = ch.pipeline();
pipeline.addLast(new ClientReplayingMessageDecoder());
pipeline.addLast(new MessageEncoder(new GlobalStats()));
}
};
}
}
================================================
FILE: client/src/main/java/cc/blynk/client/enums/ClientMode.java
================================================
package cc.blynk.client.enums;
/**
* The Blynk Project.
* Created by Dmitriy Dumanskiy.
* Created on 2/16/2015.
*/
public enum ClientMode {
APP, HARDWARE, TEST;
public static ClientMode parse(String val) {
for (ClientMode clientMode : values()) {
if (clientMode.name().equalsIgnoreCase(val)) {
return clientMode;
}
}
throw new RuntimeException("Wrong client mode. app and hardware only supported.");
}
}
================================================
FILE: client/src/main/java/cc/blynk/client/handlers/ClientReplayingMessageDecoder.java
================================================
package cc.blynk.client.handlers;
import cc.blynk.client.handlers.decoders.ClientMessageDecoder;
import io.netty.channel.ChannelHandlerContext;
import java.io.IOException;
/**
* The Blynk Project.
* Created by Dmitriy Dumanskiy.
* Created on 2/20/2015.
*/
public class ClientReplayingMessageDecoder extends ClientMessageDecoder {
@Override
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
throw new IOException("Server closed client connection.");
}
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
//server goes down
if (cause instanceof IOException) {
ctx.close();
log.error("Client socket closed. Reason : {}", cause.getMessage());
//todo find better way
System.exit(0);
}
}
}
================================================
FILE: client/src/main/java/cc/blynk/client/handlers/decoders/AppClientMessageDecoder.java
================================================
package cc.blynk.client.handlers.decoders;
import cc.blynk.server.core.protocol.enums.Command;
import cc.blynk.server.core.protocol.handlers.decoders.MobileMessageDecoder;
import cc.blynk.server.core.protocol.model.messages.BinaryMessage;
import cc.blynk.server.core.protocol.model.messages.MessageBase;
import cc.blynk.server.core.protocol.model.messages.ResponseMessage;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.ByteToMessageDecoder;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.nio.charset.StandardCharsets;
import java.util.List;
import static cc.blynk.server.core.protocol.enums.Command.GET_ENHANCED_GRAPH_DATA;
import static cc.blynk.server.core.protocol.enums.Command.GET_PROJECT_BY_CLONE_CODE;
import static cc.blynk.server.core.protocol.enums.Command.GET_PROJECT_BY_TOKEN;
import static cc.blynk.server.core.protocol.enums.Command.LOAD_PROFILE_GZIPPED;
import static cc.blynk.server.core.protocol.handlers.DefaultExceptionHandler.handleGeneralException;
import static cc.blynk.server.core.protocol.model.messages.MessageFactory.produce;
/**
* Decodes input byte array into java message.
*
* The Blynk Project.
* Created by Dmitriy Dumanskiy.
* Created on 2/1/2015.
*/
public class AppClientMessageDecoder extends ByteToMessageDecoder {
protected static final Logger log = LogManager.getLogger(AppClientMessageDecoder.class);
@Override
protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) {
if (in.readableBytes() < MobileMessageDecoder.PROTOCOL_APP_HEADER_SIZE) {
return;
}
in.markReaderIndex();
short command = in.readUnsignedByte();
int messageId = in.readUnsignedShort();
MessageBase message;
if (command == Command.RESPONSE) {
int responseCode = (int) in.readUnsignedInt();
message = new ResponseMessage(messageId, responseCode);
} else {
int length = (int) in.readUnsignedInt();
if (in.readableBytes() < length) {
in.resetReaderIndex();
return;
}
ByteBuf buf = in.readSlice(length);
switch (command) {
case GET_ENHANCED_GRAPH_DATA :
case GET_PROJECT_BY_CLONE_CODE :
case LOAD_PROFILE_GZIPPED :
case GET_PROJECT_BY_TOKEN :
byte[] bytes = new byte[buf.readableBytes()];
buf.readBytes(bytes);
message = new BinaryMessage(messageId, command, bytes);
break;
default:
message = produce(messageId, command, buf.toString(StandardCharsets.UTF_8));
}
}
log.trace("Incoming client {}", message);
out.add(message);
}
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
handleGeneralException(ctx, cause);
}
}
================================================
FILE: client/src/main/java/cc/blynk/client/handlers/decoders/ClientMessageDecoder.java
================================================
package cc.blynk.client.handlers.decoders;
import cc.blynk.server.core.protocol.enums.Command;
import cc.blynk.server.core.protocol.handlers.DefaultExceptionHandler;
import cc.blynk.server.core.protocol.model.messages.BinaryMessage;
import cc.blynk.server.core.protocol.model.messages.MessageBase;
import cc.blynk.server.core.protocol.model.messages.ResponseMessage;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.ByteToMessageDecoder;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.nio.charset.StandardCharsets;
import java.util.List;
import static cc.blynk.server.core.protocol.enums.Command.GET_ENHANCED_GRAPH_DATA;
import static cc.blynk.server.core.protocol.enums.Command.GET_PROJECT_BY_CLONE_CODE;
import static cc.blynk.server.core.protocol.enums.Command.GET_PROJECT_BY_TOKEN;
import static cc.blynk.server.core.protocol.enums.Command.LOAD_PROFILE_GZIPPED;
import static cc.blynk.server.core.protocol.model.messages.MessageFactory.produce;
/**
* Decodes input byte array into java message.
*
* The Blynk Project.
* Created by Dmitriy Dumanskiy.
* Created on 2/1/2015.
*/
public class ClientMessageDecoder extends ByteToMessageDecoder {
protected static final Logger log = LogManager.getLogger(ClientMessageDecoder.class);
@Override
protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) {
if (in.readableBytes() < 5) {
return;
}
in.markReaderIndex();
short command = in.readUnsignedByte();
int messageId = in.readUnsignedShort();
MessageBase message;
if (command == Command.RESPONSE) {
int responseCode = in.readUnsignedShort();
message = new ResponseMessage(messageId, responseCode);
} else {
int length = in.readUnsignedShort();
if (in.readableBytes() < length) {
in.resetReaderIndex();
return;
}
ByteBuf buf = in.readSlice(length);
switch (command) {
case GET_ENHANCED_GRAPH_DATA :
case GET_PROJECT_BY_CLONE_CODE :
case LOAD_PROFILE_GZIPPED :
case GET_PROJECT_BY_TOKEN :
byte[] bytes = new byte[buf.readableBytes()];
buf.readBytes(bytes);
message = new BinaryMessage(messageId, command, bytes);
break;
default:
message = produce(messageId, command, buf.toString(StandardCharsets.UTF_8));
}
}
log.trace("Incoming client {}", message);
out.add(message);
}
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
DefaultExceptionHandler.handleGeneralException(ctx, cause);
}
}
================================================
FILE: client/src/main/java/cc/blynk/client/handlers/hardware/HardwareEchoHandler.java
================================================
package cc.blynk.client.handlers.hardware;
import cc.blynk.server.core.model.enums.PinType;
import cc.blynk.server.core.protocol.enums.Command;
import cc.blynk.server.core.protocol.model.messages.MessageFactory;
import cc.blynk.server.core.protocol.model.messages.common.HardwareMessage;
import cc.blynk.utils.NumberUtil;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import java.util.concurrent.ThreadLocalRandom;
/**
* The Blynk Project.
* Created by Dmitriy Dumanskiy.
* Created on 29.07.15.
*/
@ChannelHandler.Sharable
public class HardwareEchoHandler extends SimpleChannelInboundHandler<HardwareMessage> {
@Override
protected void channelRead0(ChannelHandlerContext ctx, HardwareMessage msg) {
if (msg.body.charAt(1) == 'm') {
return;
}
String[] split = msg.body.split("\0");
PinType pinType = PinType.getPinType(split[0].charAt(0));
short pin = NumberUtil.parsePin(split[1]);
//String value = split[2];
switch (msg.body.charAt(1)) {
case 'r' :
read(ctx, pinType, pin, msg.id);
break;
case 'w' :
//write();
break;
default:
break;
}
}
private void read(ChannelHandlerContext ctx, PinType pinType, short pin, int msgId) {
String value = "";
if (pinType == PinType.VIRTUAL) {
if (pin == 0) {
value = String.valueOf(ThreadLocalRandom.current().nextDouble(100));
}
if (pin == 1) {
value = String.valueOf(ThreadLocalRandom.current().nextInt(-100, 0));
}
if (pin == 2) {
value = String.valueOf(ThreadLocalRandom.current().nextInt(100));
}
if (pin == 3) {
value = String.valueOf(ThreadLocalRandom.current().nextDouble(-100, 100));
}
if (pin == 11) {
ctx.writeAndFlush(MessageFactory.produce(msgId,
Command.PUSH_NOTIFICATION, "You pressed button on V11"));
}
if (pin == 12) {
value = String.valueOf("1234567890" + ThreadLocalRandom.current().nextDouble(100));
}
if (pin == 13) {
value = String.valueOf("123456789012345678901234567890"
+ ThreadLocalRandom.current().nextDouble(100));
}
}
if (!"".equals(value)) {
ctx.writeAndFlush(MessageFactory.produce(msgId, Command.HARDWARE,
String.valueOf(pinType.pintTypeChar) + 'w' + '\0' + pin + '\0' + value));
}
}
}
================================================
FILE: client/src/main/resources/log4j2.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level - %msg%n"/>
</Console>
</appenders>
<loggers>
<Logger name="io.netty" level="OFF" additivity="false">
<appender-ref ref="Console"/>
</Logger>
<root level="trace">
<appender-ref ref="Console"/>
</root>
</loggers>
</configuration>
================================================
FILE: client/src/main/resources/test.crt
================================================
-----BEGIN CERTIFICATE-----
MIIDfjCCAmYCCQD0IGVOPMSODzANBgkqhkiG9w0BAQUFADCBgDELMAkGA1UEBhMC
VUExCjAIBgNVBAgMAVwxDTALBgNVBAcMBEt5aXYxDjAMBgNVBAoMBUJseW5rMQww
CgYDVQQLDANXZWIxFzAVBgNVBAMMDmNsb3VkLmJseW5rLmNjMR8wHQYJKoZIhvcN
AQkBFhBkbWl0cml5QGJseW5rLmNjMB4XDTE1MDIxNTIxMjg1N1oXDTE2MDIxNTIx
Mjg1N1owgYAxCzAJBgNVBAYTAlVBMQowCAYDVQQIDAFcMQ0wCwYDVQQHDARLeWl2
MQ4wDAYDVQQKDAVCbHluazEMMAoGA1UECwwDV2ViMRcwFQYDVQQDDA5jbG91ZC5i
bHluay5jYzEfMB0GCSqGSIb3DQEJARYQZG1pdHJpeUBibHluay5jYzCCASIwDQYJ
KoZIhvcNAQEBBQADggEPADCCAQoCggEBALKSUC1+SIHV7zTKvh6xEZCwqu8hgWZN
b8vnXQaXqmShVbBosTWp9ToVWUtOJPEgUxYh5WKyI/u8VVVmj5Ka7jaHOzkFhE2T
usmWONr3UaQ7SMeskNViECapK5hLYnSriXM2Fjcz0PjFxx17uf18EpOPdsoIuZT2
JcUtsD+kJQDK7iYkcHTqVaOVl9jfb+WDYaPBvDvQ2MY6buksv2anM6IikxQAoED/
0D/mRNPft4QXmy78/z/f0r0QQsLeYqHN5xyhazzYlz+jzWD5vM4SjUOdFe5mYcFN
GB85VZ60IRZaSLRw/YsR2edKCZftDSmgbupTMt6P/csNsscvjJUP1tcCAwEAATAN
BgkqhkiG9w0BAQUFAAOCAQEAHWo2HJ8R3DxYlehxE+SWUb2ra6Y/4hhAAYzAat2o
vVQzZmkmXF6rYYHUkM96JxRRFNvS6q8wfSyiXktpZwXn4Cvn7TcuMq/OBLjVBv24
bc6hDhLd8yhsPTkmaDvKGO2BPHVZmM/jUxcLQfZ+/UCQM9cwzULfKVQ2oi626+48
6gRUupbEQWq1bL0kS80C0qPdjkweQBCZkotTIJKqSV1vgFDR3/V3qUKnSGq8kyEM
tGRgUGuObXHK+zVZE5hz7PNOIybiKmkfZa/pahVUQE7wvQ07NTOZFNAQYFELv4Cj
9ClM64GH+E10ukvFKY8ikvxYwwVZD4WuneATusimkA0Kyg==
-----END CERTIFICATE-----
================================================
FILE: client/src/test/java/cc/blynk/client/ClientTest.java
================================================
package cc.blynk.client;
import cc.blynk.client.core.AppClient;
import cc.blynk.client.core.HardwareClient;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
import java.io.BufferedReader;
import static cc.blynk.client.ClientLauncher.DEFAULT_APPLICATION_PORT;
import static cc.blynk.client.ClientLauncher.DEFAULT_HARDWARE_PORT;
import static cc.blynk.client.ClientLauncher.DEFAULT_HOST;
import static org.mockito.Mockito.when;
/**
* The Blynk Project.
* Created by Dmitriy Dumanskiy.
* Created on 11.03.15.
*/
@RunWith(MockitoJUnitRunner.class)
public class ClientTest {
@Mock
public BufferedReader bufferedReader;
@Test
@Ignore
public void testQuitApp() throws Exception {
AppClient testAppClient = new AppClient(DEFAULT_HOST, DEFAULT_APPLICATION_PORT);
when(bufferedReader.readLine()).thenReturn("quit");
testAppClient.start(bufferedReader);
//verify(testAppClient.responseMock, never()).channelRead(any(), any());
}
@Test
@Ignore
public void testQuitHard() throws Exception {
HardwareClient testHardClient = new HardwareClient(DEFAULT_HOST, DEFAULT_HARDWARE_PORT);
when(bufferedReader.readLine()).thenReturn("quit");
testHardClient.start(bufferedReader);
//verify(testHardClient.responseMock, never()).channelRead(any(), any());
}
}
================================================
FILE: docs/README_FOR_APP_DEVS.md
================================================
# Protocol messages
Every message consists of 2 parts.
+ Header :
+ Protocol command (1 byte);
+ MessageId (2 bytes);
+ Body message length (2 bytes);
+ Body : string (could be up to 2^15 bytes).
Blynk transfers binary messages with the following structure:
| Command | Message Id | Length/Status | Body |
|:-------------:|:-------------:|:---------------:|:--------:|
| 1 byte | 2 bytes | 2 bytes | Variable |
So, message is always "1 byte + 2 bytes + 2 bytes + messageBody.length".
### Command field
Unsigned byte.
This is 1 byte field responsible for storing command code from client, like login, ping, etc. Codes:
RESPONSE = 0;
REGISTER = 1;
LOGIN = 2;
GET_TOKEN = 5;
PING = 6;
ACTIVATE_DASHBOARD = 7;
DEACTIVATE_DASHBOARD = 8;
REFRESH_TOKEN = 9;
HARDWARE = 20;
CREATE_DASH = 21;
SAVE_DASH = 22;
DELETE_DASH = 23;
LOAD_PROFILE_GZIPPED = 24;
CREATE_WIDGET = 33;
UPDATE_WIDGET = 34;
DELETE_WIDGET = 35;
[Full list](https://github.com/blynkkk/blynk-server/blob/master/server/core/src/main/java/cc/blynk/server/core/protocol/enums/Command.java#L11)
### Message Id field
Unsigned short.
Message Id field is a 2 bytes field for defining unique message identifier. It’s used in order to distinguish
how to manage responses from hardware on mobile client. Message ID field should be generated on client’s side.
### Length field
Unsigned short.
Length field is a 2 bytes field for defining body length. Could be 0 if body is empty.
## Response Codes
OK = 200;
QUOTA_LIMIT_EXCEPTION = 1;
ILLEGAL_COMMAND = 2;
USER_NOT_REGISTERED = 3;
USER_ALREADY_REGISTERED = 4;
USER_NOT_AUTHENTICATED = 5;
NOT_ALLOWED = 6;
DEVICE_NOT_IN_NETWORK = 7;
NO_ACTIVE_DASHBOARD = 8;
INVALID_TOKEN = 9;
ILLEGAL_COMMAND_BODY = 11;
GET_GRAPH_DATA_EXCEPTION = 12;
NOTIFICATION_INVALID_BODY_EXCEPTION = 13;
NOTIFICATION_NOT_AUTHORIZED_EXCEPTION = 14;
NOTIFICATION_EXCEPTION = 15;
//reserved
BLYNK_TIMEOUT_EXCEPTION = 16;
NO_DATA_EXCEPTION = 17;
DEVICE_WENT_OFFLINE = 18;
SERVER_EXCEPTION = 19;
NOT_SUPPORTED_VERSION = 20;
Client sends commands to the server and gets response for every command sent.
For commands (register, login, saveProfile, hardware) that doesn't request any data back - 'response' (command field 0x00) message is returned.
For commands (loadProfile, getToken) that request data back - message will be returned with same command code. In case you sent 'loadProfile' you will receive 'loadProfile' command back with filled body.
[Here is the class with all of the codes](https://github.com/blynkkk/blynk-server/blob/master/server/core/src/main/java/cc/blynk/server/core/protocol/enums/Response.java#L12).
Response message structure:
| Command | Message Id | Response code |
|:-------------:|:-------------:|:---------------:|
| 1 byte | 2 bytes | 2 bytes |
## Widget types
//controls
BUTTON,
SLIDER,
VERTICAL_SLIDER,
KNOB,
TIMER,
ROTARY_KNOB,
RGB,
TWO_WAY_ARROW,
FOUR_WAY_ARROW,
ONE_AXIS_JOYSTICK,
TWO_AXIS_JOYSTICK,
GAMEPAD,
KEYPAD,
//outputs
LED,
LOGGER, //history_graph
DIGIT4_DISPLAY, //same as NUMERICAL_DISPLAY
GAUGE,
LCD_DISPLAY,
GRAPH,
LEVEL_DISPLAY,
TERMINAL,
//inputs
MICROPHONE,
GYROSCOPE,
ACCELEROMETER,
GPS,
//notifications
TWITTER,
EMAIL,
NOTIFICATION,
//other
SD_CARD,
EVENTOR,
RCT,
BRIDGE,
BLUETOOTH,
//UI
MENU
[List is here](https://github.com/blynkkk/blynk-server/blob/master/server/core/src/main/java/cc/blynk/server/core/model/enums/WidgetType.java#L8).
## JSON structure
{
"dashBoards" :
[
{
"id":1,
"name":"My Dashboard",
"isActive" : true,
"isShared" : true,
"widgets" : [
{"id":1, "x":1, "y":1, "label":"Some Text", "type":"BUTTON", "pinType":"DIGITAL", "pin":1, "value":"1"},
{"id":2, "x":1, "y":1, "label":"Some Text", "type":"SLIDER", "pinType":"DIGITAL", "pin":2, "value":"1", "state":"ON"},
{"id":3, "x":1, "y":1, "label":"Some Text", "type":"SLIDER", "pinType":"ANALOG", "pin":3, "value":"0", "state":"OFF"},
{"id":4, "x":1, "y":1, "label":"Some Text", "type":"SLIDER", "pinType":"VIRTUAL", "pin":4, "value":"244" },
{"id":5, "x":1, "y":1, "label":"Some Text", "type":"TIMER", "pinType":"DIGITAL", "pin":5, "value":"1", "startTime":0},
{"id":6, "x":1, "y":1, "label":"Some Text", "type":"LED", "pinType":"ANALOG", "pin":6, "frequency" : 100},
{"id":7, "x":1, "y":1, "label":"Some Text", "type":"DIGIT4_DISPLAY", "pinType":"ANALOG", "pin":7, "frequency" : 1000},
{"id":8, "x":1, "y":1, "label":"Some Text", "type":"GRAPH", "pinType":"ANALOG", "pin":8},
{"id":9, "x":1, "y":1, "type":"NOTIFICATION", "notifyWhenOffline":true, "androidTokens":{"uid":"token"}},
{"id":10, "x":1, "y":1, "token":"token", "secret":"secret", "type":"TWITTER"},
{"id":11, "x":1, "y":1, "type":"RTC", "pinType":"VIRTUAL", "pin":9},
{"id":12, "x":0, "y":0, "color":-1, "width":8, "height":2,
"type":"LCD",
"pins": [
{
"pin":0,
"pwmMode":false,
"rangeMappingOn":false,
"pinType":"VIRTUAL",
"value":"89.888037459418",
"min":-100,
"max":100
},
{ "pin":1,
"pwmMode":false,
"rangeMappingOn":false,
"pinType":"VIRTUAL",
"value":"-58.74774244674501",
"min":-100,
"max":100
}
],
"advancedMode":false,
"textFormatLine1":"pin1 : /pin0/",
"textFormatLine2":"pin2 : /pin1/",
"textLight":false,
"frequency":1000
}
],
"boardType":"UNO"
}
]
}
## Hardware command description
Could be found [here](https://github.com/blynkkk/blynk-library/blob/master/docs/Implementing.md#hardwarebridge-command-body).
## Command workflow
For better understanding of how commands should be processed, please have a look in integration test
it is easy understand what is going on there. You may start from [this](https://github.com/blynkkk/blynk-server/blob/master/integration-tests/src/test/java/cc/blynk/integration/tcp/MainWorkflowTest.java#L78) test.
================================================
FILE: docs/websocket/Command.js
================================================
var MsgType = {
RESPONSE : 0,
LOGIN : 2,
PING : 6,
TWEET : 12,
EMAIL : 13,
NOTIFY : 14,
BRIDGE : 15,
HW_SYNC : 16,
HW_INFO : 17,
HARDWARE : 20
};
var MsgStatus = {
OK : 200,
ILLEGAL_COMMAND : 2,
NO_ACTIVE_DASHBOARD : 8,
INVALID_TOKEN : 9,
ILLEGAL_COMMAND_BODY : 11
};
function getCommandByString(cmdString) {
switch (cmdString) {
case "ping" :
return MsgType.PING;
case "login" :
return MsgType.LOGIN;
case "hardware" :
return MsgType.HARDWARE;
}
}
function getStringByCommandCode(cmd) {
switch (cmd) {
case 0 :
return "RESPONSE";
case 20 :
return "HARDWARE";
}
}
function getStatusByCode(statusCode) {
switch (statusCode) {
case 200 :
return "OK";
case 2 :
return "ILLEGAL_COMMAND";
case 8 :
return "NO_ACTIVE_DASHBOARD";
case 9 :
return "INVALID_TOKEN";
case 11 :
return "ILLEGAL_COMMAND_BODY";
}
}
================================================
FILE: docs/websocket/README.MD
================================================
Usage :
login AUTH_TOKEN
hardware vw 1 1
ping
Have in mind socket will be closed in 15 seconds if no activity. You can change this via ```hard.socket.idle.timeout```.
================================================
FILE: docs/websocket/websocket.js.html
================================================
<html>
<head>
<title>Web Socket Performance Test</title>
</head>
<body>
<label>Connection Status:</label>
<label id="connectionLabel"></label><br />
<form onsubmit="return false;">
Command : <input type="text" id="command" value="login 7038b715824d45269a3662c9648ffb9f" style="width:500px;"/><br>
<input type="button" value="Send"
onclick="send(command.value)" />
<h3>Output</h3>
<textarea id="output" style="width:500px;height:300px;"></textarea>
<br>
<input type="button" value="Clear" onclick="clearText()">
</form>
<script src="Command.js"></script>
<script type="text/javascript">
const PING_INTERVAL_MILLIS = 5000;
var isRunning = false;
var command = document.getElementById('command');
var output = document.getElementById('output');
var connectionLabel = document.getElementById('connectionLabel');
if (!window.WebSocket) {
window.WebSocket = window.MozWebSocket;
}
if (window.WebSocket) {
socket = new WebSocket("ws://127.0.0.1:8082/websocket");
socket.binaryType = 'arraybuffer';
socket.onmessage = function(event) {
if (event.data instanceof ArrayBuffer) {
console.log(">>>", event.data);
output.value += "Receive : " + messageToDebugString(event.data) + "\r\n";
} else {
output.value = "unexpected type : " + event.data + "\r\n";
}
};
socket.onopen = function(event) {
isRunning = true;
connectionLabel.innerHTML = "Connected";
};
socket.onclose = function(event) {
isRunning = false;
connectionLabel.innerHTML = "Disconnected";
};
socket.onerror = function(event) {
connectionLabel.innerHTML = "Error";
};
} else {
alert("Your browser does not support Web Socket.");
}
window.setInterval(function() {
send("ping");
}, PING_INTERVAL_MILLIS);
function messageToDebugString(bufArray) {
var dataview = new DataView(bufArray);
var cmdString = getStringByCommandCode(dataview.getInt8(0));
var msgId = dataview.getUint16(1);
var responseCode = getStatusByCode(dataview.getUint16(3));
return "Command : " + cmdString + ", msgId : " + msgId + ", responseCode : " + responseCode;
}
function send(data) {
if (!window.WebSocket || !isRunning) {
return;
}
if (socket.readyState == WebSocket.OPEN) {
var commandAndBody = data.split(" ");
var message = createMessage(commandAndBody);
output.value += 'sending : ' + data + '\r\n';
socket.send(message);
} else {
alert("The socket is not open.");
}
}
function createMessage(commandAndBody) {
var cmdString = commandAndBody[0];
var cmdBody = commandAndBody.length > 1 ? commandAndBody.slice(1).join('\0') : null;
var cmd = getCommandByString(cmdString);
return buildBlynkMessage(cmd, 1, cmdBody);
}
function buildBlynkMessage(cmd, msgId, cmdBody) {
const BLYNK_HEADER_SIZE = 5;
var bodyLength = (cmdBody ? cmdBody.length : 0);
var bufArray = new ArrayBuffer(BLYNK_HEADER_SIZE + bodyLength);
var dataview = new DataView(bufArray);
dataview.setInt8(0, cmd);
dataview.setInt16(1, msgId);
dataview.setInt16(3, bodyLength);
if (bodyLength > 0) {
//todo optimize. should be better way
var buf = new ArrayBuffer(bodyLength); // 2 bytes for each char
var bufView = new Uint8Array(buf);
for (var i = 0, offset = 5; i < cmdBody.length; i++, offset += 1) {
dataview.setInt8(offset, cmdBody.charCodeAt(i));
}
}
return new Uint8Array(bufArray);
}
function clearText() {
output.value="";
}
</script>
</body>
</html>
================================================
FILE: integration-tests/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>blynk</artifactId>
<groupId>cc.blynk</groupId>
<version>0.41.17-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>integration-tests</artifactId>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration>
<argLine>-Dio.netty.leakDetection.level=paranoid</argLine>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>cc.blynk.server</groupId>
<artifactId>core</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>cc.blynk.server.application</groupId>
<artifactId>tcp-app-server</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>cc.blynk.server.admin</groupId>
<artifactId>http-admin</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>cc.blynk.server.api</groupId>
<artifactId>http-api</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>cc.blynk.server</groupId>
<artifactId>launcher</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>cc.blynk</groupId>
<artifactId>client</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.asynchttpclient</groupId>
<artifactId>async-http-client</artifactId>
<version>${async-http-client.version}</version>
<exclusions>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.kenglxn.qrgen</groupId>
<artifactId>javase</artifactId>
<version>${qrgen.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>${httpclient.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<version>${httpclient.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
================================================
FILE: integration-tests/src/test/java/cc/blynk/integration/BaseTest.java
================================================
package cc.blynk.integration;
import cc.blynk.integration.model.tcp.ClientPair;
import cc.blynk.server.Holder;
import cc.blynk.utils.properties.ServerProperties;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.net.URL;
import java.nio.file.Paths;
import java.util.Collections;
import java.util.zip.InflaterInputStream;
import static cc.blynk.integration.TestUtil.createDefaultHolder;
/**
* The Blynk Project.
* Created by Dmitriy Dumanskiy.
* Created on 20.01.16.
*/
public abstract class BaseTest extends CounterBase {
public static ServerProperties properties;
//tcp app/hardware ports
public static int tcpHardPort;
public Holder holder;
@Before
public void initHolderAndDataFolder() {
properties.setProperty("data.folder", getDataFolder());
this.holder = createDefaultHolder(properties, "no-db.properties");
}
@BeforeClass
public static void initProps() {
properties = new ServerProperties(Collections.emptyMap());
tcpHardPort = properties.getHttpPort();
}
@After
public void closeTransport() {
holder.close();
}
public static String getRelativeDataFolder(String path) {
URL resource = BaseTest.class.getResource(path);
URI uri = null;
try {
uri = resource.toURI();
} catch (Exception e) {
//ignoring. that's fine.
}
String resourcesPath = Paths.get(uri).toAbsolutePath().toString();
System.out.println("Resource path : " + resourcesPath);
return resourcesPath;
}
public static ClientPair initAppAndHardPair() throws Exception {
return TestUtil.initAppAndHardPair("localhost", properties.getHttpsPort(), tcpHardPort, getUserName(), "1", "user_profile_json.txt", properties, 10000);
}
//for tests only
public static byte[] decompress(byte[] bytes) {
try (InputStream in = new InflaterInputStream(new ByteArrayInputStream(bytes))) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
byte[] buffer = new byte[4096];
int len;
while ((len = in.read(buffer)) > 0) {
baos.write(buffer, 0, len);
}
return baos.toByteArray();
} catch (IOException e) {
throw new AssertionError(e);
}
}
public static ClientPair initAppAndHardPair(String jsonProfile) throws Exception {
return TestUtil.initAppAndHardPair("localhost", properties.getHttpsPort(), tcpHardPort, getUserName(), "1", jsonProfile, properties, 10000);
}
public static ClientPair initAppAndHardPair(int tcpAppPort, int tcpHartPort, ServerProperties properties) throws Exception {
return TestUtil.initAppAndHardPair("localhost", tcpAppPort, tcpHartPort, getUserName(), "1", "user_profile_json.txt", properties, 10000);
}
public static ClientPair initAppAndHardPair(ServerProperties properties) throws Exception {
return TestUtil.initAppAndHardPair("localhost", properties.getHttpsPort(), properties.getHttpPort(), getUserName(), "1", "user_profile_json.txt", properties, 10000);
}
}
================================================
FILE: integration-tests/src/test/java/cc/blynk/integration/CounterBase.java
================================================
package cc.blynk.integration;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.junit.Before;
import java.security.Security;
import java.util.concurrent.atomic.AtomicLong;
public abstract class CounterBase {
private static final String DEFAULT_TEST_USER = "dima@mail.ua";
private static final AtomicLong userCounter = new AtomicLong();
static {
Security.addProvider(new BouncyCastleProvider());
}
//generates unique name of a user, so every test is independent from others
//name is unique only within the test
public static String getUserName() {
return userCounter.get() + DEFAULT_TEST_USER;
}
protected static String incrementAndGetUserName() {
return userCounter.incrementAndGet() + DEFAULT_TEST_USER;
}
@Before
public void incrementCounter() {
userCounter.incrementAndGet();
}
public String getDataFolder() {
return TestUtil.getDataFolder();
}
}
================================================
FILE: integration-tests/src/test/java/cc/blynk/integration/MyHostVerifier.java
================================================
package cc.blynk.integration;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLSession;
public class MyHostVerifier implements HostnameVerifier {
@Override
public boolean verify(String s, SSLSession sslSession) {
return true;
}
}
================================================
FILE: integration-tests/src/test/java/cc/blynk/integration/SingleServerInstancePerTest.java
================================================
package cc.blynk.integration;
import cc.blynk.integration.model.tcp.ClientPair;
import cc.blynk.server.Holder;
import cc.blynk.server.servers.BaseServer;
import cc.blynk.server.servers.application.MobileAndHttpsServer;
import cc.blynk.server.servers.hardware.HardwareAndHttpAPIServer;
import cc.blynk.utils.properties.ServerProperties;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import java.util.Collections;
import static cc.blynk.integration.TestUtil.createDefaultHolder;
import static org.mockito.Mockito.reset;
/**
* use when you need only 1 server instance per test class and not per test method
*/
public abstract class SingleServerInstancePerTest extends CounterBase {
protected static ServerProperties properties;
protected static BaseServer appServer;
protected static BaseServer hardwareServer;
protected static Holder holder;
protected ClientPair clientPair;
@BeforeClass
public static void init() throws Exception {
properties = new ServerProperties(Collections.emptyMap());
properties.setProperty("data.folder", TestUtil.getDataFolder());
holder = createDefaultHolder(properties, "no-db.properties");
hardwareServer = new HardwareAndHttpAPIServer(holder).start();
appServer = new MobileAndHttpsServer(holder).start();
}
@AfterClass
public static void shutdown() {
appServer.close();
hardwareServer.close();
holder.close();
}
@After
public void closeClients() {
this.clientPair.stop();
}
@Before
public void resetBeforeTest() throws Exception {
this.clientPair = initClientPair();
reset(holder.mailWrapper);
reset(holder.twitterWrapper);
reset(holder.gcmWrapper);
reset(holder.smsWrapper);
}
public ClientPair initAppAndHardPair() throws Exception {
return TestUtil.initAppAndHardPair("localhost",
properties.getHttpsPort(), properties.getHttpPort(),
getUserName(), "1", changeProfileTo(), properties, 10000);
}
protected String changeProfileTo() {
return "user_profile_json.txt";
}
protected ClientPair initClientPair() throws Exception {
return initAppAndHardPair();
}
}
================================================
FILE: integration-tests/src/test/java/cc/blynk/integration/SingleServerInstancePerTestWithDB.java
================================================
package cc.blynk.integration;
import cc.blynk.integration.model.tcp.ClientPair;
import cc.blynk.server.Holder;
import cc.blynk.server.servers.BaseServer;
import cc.blynk.server.servers.application.MobileAndHttpsServer;
import cc.blynk.server.servers.hardware.HardwareAndHttpAPIServer;
import cc.blynk.utils.properties.ServerProperties;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import java.util.Collections;
import static cc.blynk.integration.TestUtil.createDefaultHolder;
import static org.junit.Assert.assertNotNull;
import static org.mockito.Mockito.reset;
/**
* use when you need only 1 server instance per test class and not per test method
*/
public abstract class SingleServerInstancePerTestWithDB extends CounterBase {
protected static ServerProperties properties;
protected static BaseServer appServer;
protected static BaseServer hardwareServer;
protected static Holder holder;
protected ClientPair clientPair;
@BeforeClass
public static void init() throws Exception {
properties = new ServerProperties(Collections.emptyMap());
properties.setProperty("data.folder", TestUtil.getDataFolder());
holder = createDefaultHolder(properties, "db-test.properties");
hardwareServer = new HardwareAndHttpAPIServer(holder).start();
appServer = new MobileAndHttpsServer(holder).start();
assertNotNull(holder.dbManager.getConnection());
}
@AfterClass
public static void shutdown() {
appServer.close();
hardwareServer.close();
holder.close();
}
@After
public void closeClients() {
this.clientPair.stop();
}
@Before
public void resetBeforeTest() throws Exception {
this.clientPair = initClientPair();
reset(holder.mailWrapper);
reset(holder.twitterWrapper);
reset(holder.gcmWrapper);
reset(holder.smsWrapper);
}
public ClientPair initAppAndHardPair() throws Exception {
return TestUtil.initAppAndHardPair("localhost",
properties.getHttpsPort(), properties.getHttpPort(),
getUserName(), "1", changeProfileTo(), properties, 10000);
}
protected String changeProfileTo() {
return "user_profile_json.txt";
}
protected ClientPair initClientPair() throws Exception {
return initAppAndHardPair();
}
}
================================================
FILE: integration-tests/src/test/java/cc/blynk/integration/TestUtil.java
================================================
package cc.blynk.integration;
import cc.blynk.integration.model.SimpleClientHandler;
import cc.blynk.integration.model.tcp.ClientPair;
import cc.blynk.integration.model.tcp.TestAppClient;
import cc.blynk.integration.model.tcp.TestHardClient;
import cc.blynk.server.Holder;
import cc.blynk.server.core.BlockingIOProcessor;
import cc.blynk.server.core.model.DashBoard;
import cc.blynk.server.core.model.DataStream;
import cc.blynk.server.core.model.Profile;
import cc.blynk.server.core.model.device.Device;
import cc.blynk.server.core.model.device.Tag;
import cc.blynk.server.core.model.serialization.JsonParser;
import cc.blynk.server.core.model.widgets.MobileSyncWidget;
import cc.blynk.server.core.model.widgets.MultiPinWidget;
import cc.blynk.server.core.model.widgets.OnePinWidget;
import cc.blynk.server.core.model.widgets.Widget;
import cc.blynk.server.core.protocol.model.messages.MessageBase;
import cc.blynk.server.core.protocol.model.messages.ResponseMessage;
import cc.blynk.server.core.protocol.model.messages.StringMessage;
import cc.blynk.server.core.protocol.model.messages.appllication.GetServerMessage;
import cc.blynk.server.core.protocol.model.messages.common.HardwareMessage;
import cc.blynk.server.notifications.mail.MailWrapper;
import cc.blynk.server.notifications.push.GCMWrapper;
import cc.blynk.server.notifications.sms.SMSWrapper;
import cc.blynk.server.notifications.twitter.TwitterWrapper;
import cc.blynk.utils.AppNameUtil;
import cc.blynk.utils.StringUtils;
import cc.blynk.utils.properties.ServerProperties;
import com.fasterxml.jackson.databind.ObjectReader;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.util.EntityUtils;
import org.mockito.ArgumentCaptor;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.attribute.FileAttribute;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;
import static cc.blynk.server.core.protocol.enums.Command.APP_SYNC;
import static cc.blynk.server.core.protocol.enums.Command.BLYNK_INTERNAL;
import static cc.blynk.server.core.protocol.enums.Command.BRIDGE;
import static cc.blynk.server.core.protocol.enums.Command.CONNECT_REDIRECT;
import static cc.blynk.server.core.protocol.enums.Command.CREATE_DEVICE;
import static cc.blynk.server.core.protocol.enums.Command.CREATE_TAG;
import static cc.blynk.server.core.protocol.enums.Command.DEVICE_OFFLINE;
import static cc.blynk.server.core.protocol.enums.Command.GET_PROJECT_BY_CLONE_CODE;
import static cc.blynk.server.core.protocol.enums.Command.GET_PROJECT_BY_TOKEN;
import static cc.blynk.server.core.protocol.enums.Command.GET_PROVISION_TOKEN;
import static cc.blynk.server.core.protocol.enums.Command.HARDWARE_CONNECTED;
import static cc.blynk.server.core.protocol.enums.Command.LOAD_PROFILE_GZIPPED;
import static cc.blynk.server.core.protocol.enums.Command.OUTDATED_APP_NOTIFICATION;
import static cc.blynk.server.core.protocol.enums.Command.SET_WIDGET_PROPERTY;
import static cc.blynk.server.core.protocol.enums.Response.ILLEGAL_COMMAND;
import static cc.blynk.server.core.protocol.enums.Response.ILLEGAL_COMMAND_BODY;
import static cc.blynk.server.core.protocol.enums.Response.INVALID_TOKEN;
import static cc.blynk.server.core.protocol.enums.Response.NOT_ALLOWED;
import static cc.blynk.server.core.protocol.enums.Response.OK;
import static cc.blynk.server.core.protocol.enums.Response.SERVER_ERROR;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.timeout;
import static org.mockito.Mockito.verify;
public final class TestUtil {
private static final ObjectReader profileReader = JsonParser.init().readerFor(Profile.class);
private TestUtil() {
}
public static String getBody(SimpleClientHandler responseMock) throws Exception {
return getBody(responseMock, 1);
}
public static String getBody(SimpleClientHandler responseMock, int expectedMessageOrder) throws Exception {
ArgumentCaptor<MessageBase> objectArgumentCaptor = ArgumentCaptor.forClass(MessageBase.class);
verify(responseMock, timeout(1000).times(expectedMessageOrder)).channelRead(any(), objectArgumentCaptor.capture());
List<MessageBase> arguments = objectArgumentCaptor.getAllValues();
MessageBase messageBase = arguments.get(expectedMessageOrder - 1);
if (messageBase instanceof StringMessage) {
return ((StringMessage) messageBase).body;
} else if (messageBase.command == LOAD_PROFILE_GZIPPED
|| messageBase.command == GET_PROJECT_BY_TOKEN
|| messageBase.command == GET_PROVISION_TOKEN
|| messageBase.command == GET_PROJECT_BY_CLONE_CODE) {
return new String(BaseTest.decompress(messageBase.getBytes()));
}
throw new RuntimeException("Unexpected message");
}
public static Profile parseProfile(InputStream reader) throws Exception {
return profileReader.readValue(reader);
}
public static Profile parseProfile(String reader) throws Exception {
return profileReader.readValue(reader);
}
public static String readTestUserProfile(String fileName) throws Exception{
InputStream is = TestUtil.class.getResourceAsStream("/json_test/" + fileName);
Profile profile = parseProfile(is);
return profile.toString();
}
public static String readTestUserProfile() throws Exception {
return readTestUserProfile("user_profile_json.txt");
}
public static void saveProfile(TestAppClient appClient, DashBoard... dashBoards) {
for (DashBoard dash : dashBoards) {
appClient.createDash(dash);
}
}
public static String b(String body) {
return body.replaceAll(" ", StringUtils.BODY_SEPARATOR_STRING);
}
public static ResponseMessage illegalCommand(int msgId) {
return new ResponseMessage(msgId, ILLEGAL_COMMAND);
}
public static ResponseMessage illegalCommandBody(int msgId) {
return new ResponseMessage(msgId, ILLEGAL_COMMAND_BODY);
}
public static ResponseMessage ok(int msgId) {
return new ResponseMessage(msgId, OK);
}
public static StringMessage bridge(int msgId, String body) {
return new StringMessage(msgId, BRIDGE, b(body));
}
public static StringMessage internal(int msgId, String body) {
return new StringMessage(msgId, BLYNK_INTERNAL, b(body));
}
public static StringMessage hardwareConnected(int msgId, String body) {
return new StringMessage(msgId, HARDWARE_CONNECTED, body);
}
public static GetServerMessage getServer(int msgId, String body) {
return new GetServerMessage(msgId, body);
}
public static StringMessage deviceOffline(int msgId, String body) {
return new StringMessage(msgId, DEVICE_OFFLINE, body);
}
public static StringMessage createTag(int msgId, Tag tag) {
return createTag(msgId, tag.toString());
}
public static StringMessage createTag(int msgId, String body) {
return new StringMessage(msgId, CREATE_TAG, body);
}
public static StringMessage appIsOutdated(int msgId, String body) {
return new StringMessage(msgId, OUTDATED_APP_NOTIFICATION, body);
}
public static StringMessage appSync(int msgId, String body) {
return new StringMessage(msgId, APP_SYNC, b(body));
}
public static StringMessage hardware(int msgId, String body) {
return new HardwareMessage(msgId, b(body));
}
public static StringMessage appSync(String body) {
return appSync(MobileSyncWidget.SYNC_DEFAULT_MESSAGE_ID, body);
}
public static StringMessage setProperty(int msgId, String body) {
return new StringMessage(msgId, SET_WIDGET_PROPERTY, b(body));
}
public static StringMessage createDevice(int msgId, String body) {
return new StringMessage(msgId, CREATE_DEVICE, body);
}
public static StringMessage createDevice(int msgId, Device device) {
return createDevice(msgId, device.toString());
}
public static StringMessage connectRedirect(int msgId, String body) {
return new StringMessage(msgId, CONNECT_REDIRECT, b(body));
}
public static ResponseMessage serverError(int msgId) {
return new ResponseMessage(msgId, SERVER_ERROR);
}
public static ResponseMessage notAllowed(int msgId) {
return new ResponseMessage(msgId, NOT_ALLOWED);
}
public static ResponseMessage invalidToken(int msgId) {
return new ResponseMessage(msgId, INVALID_TOKEN);
}
public static ClientPair initAppAndHardPair(String host, int appPort, int hardPort,
String user, String pass,
String jsonProfile,
ServerProperties properties, int energy) throws Exception {
TestAppClient appClient = new TestAppClient(host, appPort, properties);
TestHardClient hardClient = new TestHardClient(host, hardPort);
return initAppAndHardPair(appClient, hardClient, user, pass, jsonProfile, energy);
}
public static ClientPair initAppAndHardPair(TestAppClient appClient, TestHardClient hardClient,
String user, String pass,
String jsonProfile, int energy) throws Exception {
appClient.start();
hardClient.start();
String userProfileString = readTestUserProfile(jsonProfile);
Profile profile = parseProfile(userProfileString);
int expectedSyncCommandsCount = 0;
for (Widget widget : profile.dashBoards[0].widgets) {
if (widget instanceof OnePinWidget) {
if (((OnePinWidget) widget).makeHardwareBody() != null) {
expectedSyncCommandsCount++;
}
} else if (widget instanceof MultiPinWidget) {
MultiPinWidget multiPinWidget = (MultiPinWidget) widget;
if (multiPinWidget.dataStreams != null) {
if (multiPinWidget.isSplitMode()) {
for (DataStream dataStream : multiPinWidget.dataStreams) {
if (dataStream.notEmptyAndIsValid()) {
expectedSyncCommandsCount++;
}
}
} else {
if (multiPinWidget.dataStreams[0].notEmptyAndIsValid()) {
expectedSyncCommandsCount++;
}
}
}
}
}
int dashId = profile.dashBoards[0].id;
appClient.register(user, pass, AppNameUtil.BLYNK);
appClient.login(user, pass, "Android", "1.10.4");
int rand = ThreadLocalRandom.current().nextInt();
appClient.send("addEnergy " + energy + "\0" + String.valueOf(rand));
//we should wait until login finished. Only after that we can send commands
verify(appClient.responseMock, timeout(1000)).channelRead(any(), eq(ok(2)));
saveProfile(appClient, profile.dashBoards);
appClient.activate(dashId);
ArgumentCaptor<Object> objectArgumentCaptor = ArgumentCaptor.forClass(Object.class);
verify(appClient.responseMock, timeout(2000).times(4 + profile.dashBoards.length + expectedSyncCommandsCount)).channelRead(any(), objectArgumentCaptor.capture());
appClient.getDevice(dashId, 0);
Device device = appClient.parseDevice(5 + profile.dashBoards.length + expectedSyncCommandsCount);
String token = device.token;
hardClient.login(token);
verify(hardClient.responseMock, timeout(2000)).channelRead(any(), eq(ok(1)));
verify(appClient.responseMock, timeout(2000)).channelRead(any(), eq(hardwareConnected(1, "" + dashId + "-0")));
appClient.reset();
hardClient.reset();
return new ClientPair(appClient, hardClient, token);
}
public static String getDataFolder() {
try {
return Files.createTempDirectory("blynk_test_", new FileAttribute[0]).toString();
} catch (IOException e) {
throw new RuntimeException("Unable create temp dir.", e);
}
}
public static void sleep(int ms) {
try {
Thread.sleep(ms);
} catch (InterruptedException e) {
//we can ignore it
}
}
@SuppressWarnings("unchecked")
public static List<String> consumeJsonPinValues(String response) {
return JsonParser.readAny(response, List.class);
}
@SuppressWarnings("unchecked")
public static List<String> consumeJsonPinValues(CloseableHttpResponse response) throws IOException {
return JsonParser.readAny(consumeText(response), List.class);
}
@SuppressWarnings("unchecked")
public static String consumeText(CloseableHttpResponse response) throws IOException {
return EntityUtils.toString(response.getEntity());
}
public static SSLContext initUnsecuredSSLContext() throws NoSuchAlgorithmException, KeyManagementException {
X509TrustManager tm = new X509TrustManager() {
@Override
public void checkClientTrusted(java.security.cert.X509Certificate[] x509Certificates, String s) {
}
@Override
public void checkServerTrusted(java.security.cert.X509Certificate[] x509Certificates, String s) {
}
@Override
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return null;
}
};
SSLContext context = SSLContext.getInstance("TLS");
context.init(null, new TrustManager[]{ tm }, null);
return context;
}
public static Holder createHolderWithIOMock(ServerProperties serverProperties,
String dbFileName) {
return new Holder(serverProperties,
mock(TwitterWrapper.class),
mock(MailWrapper.class),
mock(GCMWrapper.class),
mock(SMSWrapper.class),
mock(BlockingIOProcessor.class),
dbFileName);
}
public static Holder createDefaultHolder(ServerProperties serverProperties,
String dbFileName) {
return new Holder(serverProperties,
mock(TwitterWrapper.class),
mock(MailWrapper.class),
mock(GCMWrapper.class),
mock(SMSWrapper.class),
new BlockingIOProcessor(
serverProperties.getIntProperty("blocking.processor.thread.pool.limit", 1),
serverProperties.getIntProperty("notifications.queue.limit", 100)
), dbFileName);
}
}
================================================
FILE: integration-tests/src/test/java/cc/blynk/integration/http/AcmeTest.java
================================================
package cc.blynk.integration.http;
import cc.blynk.integration.BaseTest;
import cc.blynk.server.Holder;
import cc.blynk.server.SslContextHolder;
import cc.blynk.server.acme.AcmeClient;
import cc.blynk.server.acme.ContentHolder;
import cc.blynk.server.servers.BaseServer;
import cc.blynk.server.servers.hardware.HardwareAndHttpAPIServer;
import cc.blynk.server.workers.CertificateRenewalWorker;
import cc.blynk.utils.properties.ServerProperties;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
import org.mockito.junit.MockitoJUnitRunner;
import java.util.Collections;
import static cc.blynk.integration.TestUtil.createDefaultHolder;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
/**
* The Blynk Project.
* Created by Dmitriy Dumanskiy.
* Created on 07.01.16.
*/
@RunWith(MockitoJUnitRunner.class)
public class AcmeTest extends BaseTest {
private BaseServer httpServer;
private Holder holder2;
@After
public void shutdown() {
httpServer.close();
}
@Before
public void init() throws Exception {
ServerProperties properties2 = new ServerProperties(Collections.emptyMap(), "no_certs.properties");
this.holder2 = createDefaultHolder(properties2, "no-db.properties");
httpServer = new HardwareAndHttpAPIServer(holder2).start();
}
@Override
public String getDataFolder() {
return getRelativeDataFolder("/profiles");
}
@Test
public void testCorrectContext() {
SslContextHolder sslContextHolder = holder2.sslContextHolder;
assertNotNull(sslContextHolder);
assertTrue(sslContextHolder.runRenewalWorker());
assertTrue(sslContextHolder.isNeedInitializeOnStart);
assertNotNull(sslContextHolder.acmeClient);
}
@Test
@Ignore
public void testCreateCertificates() throws Exception {
final String STAGING = "acme://letsencrypt.org/staging";
ContentHolder contentHolder = holder2.sslContextHolder.contentHolder;
assertNull(contentHolder.content);
AcmeClient acmeClient = new AcmeClient(STAGING, "test@blynk.cc", "let.blynk.cc", contentHolder);
acmeClient.requestCertificate();
assertNotNull(contentHolder.content);
}
@Test
@Ignore
public void testWorker() throws Exception {
AcmeClient acmeClient = Mockito.mock(AcmeClient.class);
SslContextHolder sslContextHolder = Mockito.mock(SslContextHolder.class);
CertificateRenewalWorker certificateRenewalWorker = new CertificateRenewalWorker(sslContextHolder);
certificateRenewalWorker.run();
verify(acmeClient, times(0)).requestCertificate();
certificateRenewalWorker = new CertificateRenewalWorker(sslContextHolder);
certificateRenewalWorker.run();
verify(acmeClient, times(1)).requestCertificate();
}
}
================================================
FILE: integration-tests/src/test/java/cc/blynk/integration/http/HttpAPIKeepAliveServerTest.java
================================================
package cc.blynk.integration.http;
import cc.blynk.integration.BaseTest;
import cc.blynk.server.servers.BaseServer;
import cc.blynk.server.servers.hardware.HardwareAndHttpAPIServer;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.junit.MockitoJUnitRunner;
import java.util.List;
import static cc.blynk.integration.TestUtil.consumeJsonPinValues;
import static cc.blynk.server.core.protocol.enums.Command.HTTP_GET_PIN_DATA;
import static cc.blynk.server.core.protocol.enums.Command.HTTP_UPDATE_PIN_DATA;
import static org.junit.Assert.assertEquals;
/**
* The Blynk Project.
* Created by Dmitriy Dumanskiy.
* Created on 07.01.16.
*/
@RunWith(MockitoJUnitRunner.class)
public class HttpAPIKeepAliveServerTest extends BaseTest {
private BaseServer httpServer;
private CloseableHttpClient httpclient;
private String httpServerUrl;
@After
public void shutdown() throws Exception {
httpclient.close();
httpServer.close();
}
@Before
public void init() throws Exception {
httpServer = new HardwareAndHttpAPIServer(holder).start();
httpServerUrl = String.format("http://localhost:%s/", properties.getHttpPort());
//this http client doesn't close HTTP connection.
httpclient = HttpClients.custom()
.setConnectionReuseStrategy((response, context) -> true)
.setKeepAliveStrategy((response, context) -> 10000000).build();
}
@Override
public String getDataFolder() {
return getRelativeDataFolder("/profiles");
}
@Test
public void testKeepAlive() throws Exception {
HttpPut request = new HttpPut(httpServerUrl + "4ae3851817194e2596cf1b7103603ef8/update/a14");
request.setHeader("Connection", "keep-alive");
HttpGet getRequest = new HttpGet(httpServerUrl + "4ae3851817194e2596cf1b7103603ef8/get/a14");
getRequest.setHeader("Connection", "keep-alive");
for (int i = 0; i < 100; i++) {
request.setEntity(new StringEntity("[\""+ i + "\"]", ContentType.APPLICATION_JSON));
try (CloseableHttpResponse response = httpclient.execute(request)) {
assertEquals(200, response.getStatusLine().getStatusCode());
assertEquals("keep-alive", response.getFirstHeader("Connection").getValue());
EntityUtils.consume(response.getEntity());
}
try (CloseableHttpResponse response2 = httpclient.execute(getRequest)) {
assertEquals(200, response2.getStatusLine().getStatusCode());
List<String> values = consumeJsonPinValues(response2);
assertEquals("keep-alive", response2.getFirstHeader("Connection").getValue());
assertEquals(1, values.size());
assertEquals(String.valueOf(i), values.get(0));
}
}
}
@Test(expected = Exception.class)
public void keepAliveIsSupported() throws Exception{
String url = httpServerUrl + "4ae3851817194e2596cf1b7103603ef8/update/a14";
HttpPut request = new HttpPut(url);
request.setHeader("Connection", "close");
request.setEntity(new StringEntity("[\""+ 0 + "\"]", ContentType.APPLICATION_JSON));
try (CloseableHttpResponse response = httpclient.execute(request)) {
assertEquals(200, response.getStatusLine().getStatusCode());
assertEquals("close", response.getFirstHeader("Connection").getValue());
EntityUtils.consume(response.getEntity());
}
request = new HttpPut(url);
request.setHeader("Connection", "close");
request.setEntity(new StringEntity("[\""+ 0 + "\"]", ContentType.APPLICATION_JSON));
//this should fail as connection is closed and httpClient is reusing connections
try (CloseableHttpResponse response = httpclient.execute(request)) {
assertEquals(200, response.getStatusLine().getStatusCode());
}
}
@Test
public void testHttpAPICounters() throws Exception {
HttpGet getRequest = new HttpGet(httpServerUrl + "4ae3851817194e2596cf1b7103603ef8/update/v11?value=11");
try (CloseableHttpResponse response = httpclient.execute(getRequest)) {
assertEquals(200, response.getStatusLine().getStatusCode());
assertEquals(1, holder.stats.specificCounters[HTTP_UPDATE_PIN_DATA].intValue());
assertEquals(0, holder.stats.specificCounters[HTTP_GET_PIN_DATA].intValue());
assertEquals(1, holder.stats.totalMessages.getCount());
}
getRequest = new HttpGet(httpServerUrl + "4ae3851817194e2596cf1b7103603ef8/get/v11");
try (CloseableHttpResponse response = httpclient.execute(getRequest)) {
assertEquals(200, response.getStatusLine().getStatusCode());
assertEquals(1, holder.stats.specificCounters[HTTP_UPDATE_PIN_DATA].intValue());
assertEquals(1, holder.stats.specificCounters[HTTP_GET_PIN_DATA].intValue());
assertEquals(2, holder.stats.totalMessages.getCount());
}
}
}
================================================
FILE: integration-tests/src/test/java/cc/blynk/integration/http/HttpAPIPinsAsyncClientTest.java
================================================
package cc.blynk.integration.http;
import cc.blynk.integration.SingleServerInstancePerTest;
import cc.blynk.integration.TestUtil;
import cc.blynk.server.core.model.Profile;
import cc.blynk.server.core.model.enums.PinType;
import cc.blynk.server.core.model.widgets.Widget;
import cc.blynk.server.core.model.widgets.controls.Button;
import cc.blynk.server.servers.application.MobileAndHttpsServer;
import cc.blynk.server.servers.hardware.HardwareAndHttpAPIServer;
import cc.blynk.utils.FileUtils;
import cc.blynk.utils.properties.ServerProperties;
import org.asynchttpclient.AsyncHttpClient;
import org.asynchttpclient.DefaultAsyncHttpClient;
import org.asynchttpclient.DefaultAsyncHttpClientConfig;
import org.asynchttpclient.Response;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.junit.MockitoJUnitRunner;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.Future;
import static cc.blynk.integration.BaseTest.getRelativeDataFolder;
import static cc.blynk.integration.TestUtil.createHolderWithIOMock;
import static cc.blynk.integration.TestUtil.ok;
import static cc.blynk.integration.TestUtil.setProperty;
import static io.netty.handler.codec.http.HttpHeaderNames.ACCESS_CONTROL_ALLOW_ORIGIN;
import static io.netty.handler.codec.http.HttpHeaderNames.CONTENT_LENGTH;
import static io.netty.handler.codec.http.HttpHeaderNames.CONTENT_TYPE;
import static io.netty.handler.codec.http.HttpHeaderNames.LOCATION;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.timeout;
import static org.mockito.Mockito.verify;
/**
* The Blynk Project.
* Created by Dmitriy Dumanskiy.
* Created on 24.12.15.
*/
@RunWith(MockitoJUnitRunner.class)
public class HttpAPIPinsAsyncClientTest extends SingleServerInstancePerTest {
private static AsyncHttpClient httpclient;
private static String httpsServerUrl;
@AfterClass
public static void closeHttp() throws Exception {
httpclient.close();
}
@BeforeClass
public static void init() throws Exception {
properties = new ServerProperties(Collections.emptyMap());
properties.setProperty("data.folder", getRelativeDataFolder("/profiles"));
holder = createHolderWithIOMock(properties, "no-db.properties");
hardwareServer = new HardwareAndHttpAPIServer(holder).start();
appServer = new MobileAndHttpsServer(holder).start();
httpsServerUrl = String.format("http://localhost:%s/", properties.getHttpPort());
httpclient = new DefaultAsyncHttpClient(
new DefaultAsyncHttpClientConfig.Builder()
.setUserAgent(null)
.setKeepAlive(true)
.build()
);
}
//----------------------------GET METHODS SECTION
@Test
public void testGetWithFakeToken() throws Exception {
Future<Response> f = httpclient.prepareGet(httpsServerUrl + "dsadasddasdasdasdasdasdas/get/d8").execute();
Response response = f.get();
assertEquals(400, response.getStatusCode());
assertEquals("Invalid token.", response.getResponseBody());
assertEquals("*", response.getHeader(ACCESS_CONTROL_ALLOW_ORIGIN));
}
@Test
public void testGetWithWrongPathToken() throws Exception {
Future<Response> f = httpclient.prepareGet(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/w/d8").execute();
assertEquals(404, f.get().getStatusCode());
}
@Test
public void testGetWithWrongPin() throws Exception {
Future<Response> f = httpclient.prepareGet(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/get/x8").execute();
Response response = f.get();
assertEquals(400, response.getStatusCode());
assertEquals("Wrong pin format.", response.getResponseBody());
assertEquals("*", response.getHeader(ACCESS_CONTROL_ALLOW_ORIGIN));
}
@Test
public void testGetWithNonExistingPin() throws Exception {
Future<Response> f = httpclient.prepareGet(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/get/v11").execute();
Response response = f.get();
assertEquals(400, response.getStatusCode());
assertEquals("Requested pin doesn't exist in the app.", response.getResponseBody());
assertEquals("*", response.getHeader(ACCESS_CONTROL_ALLOW_ORIGIN));
}
@Test
public void testPutViaGetRequestSingleValue() throws Exception {
Future<Response> f = httpclient.prepareGet(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/update/v11?value=10").execute();
Response response = f.get();
assertEquals(200, response.getStatusCode());
assertEquals("*", response.getHeader(ACCESS_CONTROL_ALLOW_ORIGIN));
f = httpclient.prepareGet(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/get/v11").execute();
response = f.get();
assertEquals(200, response.getStatusCode());
List<String> values = TestUtil.consumeJsonPinValues(response.getResponseBody());
assertEquals(1, values.size());
assertEquals("10", values.get(0));
assertEquals("*", response.getHeader(ACCESS_CONTROL_ALLOW_ORIGIN));
}
@Test
public void testPutAndGetTerminalValue() throws Exception {
Future<Response> f= httpclient.prepareGet(httpsServerUrl + "7b0a3a61322e41a5b50589cf52d775d1/get/v17").execute();
Response response = f.get();
assertEquals(200, response.getStatusCode());
List<String> values = TestUtil.consumeJsonPinValues(response.getResponseBody());
assertEquals(0, values.size());
f = httpclient.prepareGet(httpsServerUrl
+ "7b0a3a61322e41a5b50589cf52d775d1/update/v17?value=10").execute();
response = f.get();
assertEquals(200, response.getStatusCode());
f = httpclient.prepareGet(httpsServerUrl
+ "7b0a3a61322e41a5b50589cf52d775d1/update/v17?value=11").execute();
response = f.get();
assertEquals(200, response.getStatusCode());
f = httpclient.prepareGet(httpsServerUrl + "7b0a3a61322e41a5b50589cf52d775d1/get/v17").execute();
response = f.get();
assertEquals(200, response.getStatusCode());
values = TestUtil.consumeJsonPinValues(response.getResponseBody());
assertEquals(2, values.size());
assertEquals("10", values.get(0));
assertEquals("11", values.get(1));
}
@Test
public void testPutViaGetRequestMultipleValue() throws Exception {
Future<Response> f = httpclient.prepareGet(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/update/v11?value=10&value=11").execute();
Response response = f.get();
assertEquals(200, response.getStatusCode());
assertEquals("*", response.getHeader(ACCESS_CONTROL_ALLOW_ORIGIN));
f = httpclient.prepareGet(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/get/v11").execute();
response = f.get();
assertEquals(200, response.getStatusCode());
List<String> values = TestUtil.consumeJsonPinValues(response.getResponseBody());
assertEquals(2, values.size());
assertEquals("10", values.get(0));
assertEquals("11", values.get(1));
assertEquals("*", response.getHeader(ACCESS_CONTROL_ALLOW_ORIGIN));
}
@Test
public void testPutGetNonExistingPin() throws Exception {
Future<Response> f = httpclient.preparePut(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/update/v10")
.setHeader("Content-Type", "application/json")
.setBody("[\"100\"]")
.execute();
Response response = f.get();
assertEquals(200, response.getStatusCode());
assertEquals("*", response.getHeader(ACCESS_CONTROL_ALLOW_ORIGIN));
f = httpclient.prepareGet(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/get/v10").execute();
response = f.get();
assertEquals(200, response.getStatusCode());
List<String> values = TestUtil.consumeJsonPinValues(response.getResponseBody());
assertEquals(1, values.size());
assertEquals("100", values.get(0));
assertEquals("*", response.getHeader(ACCESS_CONTROL_ALLOW_ORIGIN));
}
@Test
public void testMultiPutGetNonExistingPin() throws Exception {
Future<Response> f = httpclient.preparePut(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/update/v10")
.setHeader("Content-Type", "application/json")
.setBody("[\"100\", \"101\", \"102\"]")
.execute();
Response response = f.get();
assertEquals(200, response.getStatusCode());
assertEquals("*", response.getHeader(ACCESS_CONTROL_ALLOW_ORIGIN));
f = httpclient.prepareGet(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/get/v10").execute();
response = f.get();
assertEquals(200, response.getStatusCode());
List<String> values = TestUtil.consumeJsonPinValues(response.getResponseBody());
assertEquals(3, values.size());
assertEquals("100", values.get(0));
assertEquals("101", values.get(1));
assertEquals("102", values.get(2));
assertEquals("*", response.getHeader(ACCESS_CONTROL_ALLOW_ORIGIN));
}
@Test
public void testGetPinData() throws Exception {
Future<Response> f = httpclient.prepareGet(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/update/v111?value=10").execute();
Response response = f.get();
assertEquals(200, response.getStatusCode());
assertEquals("*", response.getHeader(ACCESS_CONTROL_ALLOW_ORIGIN));
f = httpclient.prepareGet(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/data/v111").execute();
response = f.get();
assertEquals(400, response.getStatusCode());
assertEquals("No data.", response.getResponseBody());
assertEquals("*", response.getHeader(ACCESS_CONTROL_ALLOW_ORIGIN));
f = httpclient.prepareGet(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/data/z111").execute();
response = f.get();
assertEquals(400, response.getStatusCode());
assertEquals("Wrong pin format.", response.getResponseBody());
assertEquals("*", response.getHeader(ACCESS_CONTROL_ALLOW_ORIGIN));
}
@Test
public void testGetCSVDataRedirect() throws Exception {
Path reportingPath = Paths.get(holder.reportingDiskDao.dataFolder, "dmitriy@blynk.cc");
Files.createDirectories(reportingPath);
FileUtils.write(Paths.get(reportingPath.toString(), "history_125564119-0_v10_minute.bin"), 1, 2);
Future<Response> f = httpclient.prepareGet(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/data/v10").execute();
Response response = f.get();
assertEquals(301, response.getStatusCode());
String redirectLocation = response.getHeader(LOCATION);
assertNotNull(redirectLocation);
assertTrue(redirectLocation.contains("/dmitriy@blynk.cc_125564119_0_v10_"));
assertEquals("*", response.getHeader(ACCESS_CONTROL_ALLOW_ORIGIN));
assertEquals("0", response.getHeader(CONTENT_LENGTH));
f = httpclient.prepareGet(httpsServerUrl + redirectLocation.replaceFirst("/", "")).execute();
response = f.get();
assertEquals(200, response.getStatusCode());
assertEquals("application/x-gzip", response.getHeader(CONTENT_TYPE));
assertEquals("*", response.getHeader(ACCESS_CONTROL_ALLOW_ORIGIN));
}
@Test
public void testChangeLabelPropertyViaGet() throws Exception {
Future<Response> f = httpclient.prepareGet(httpsServerUrl + clientPair.token + "/update/v4?label=My-New-Label").execute();
Response response = f.get();
assertEquals(200, response.getStatusCode());
verify(clientPair.appClient.responseMock, timeout(500)).channelRead(any(), eq(setProperty(111, "1-0 4 label My-New-Label")));
clientPair.appClient.reset();
clientPair.appClient.send("loadProfileGzipped");
Profile profile = clientPair.appClient.parseProfile(1);
Widget widget = profile.dashBoards[0].findWidgetByPin(0, (short) 4, PinType.VIRTUAL);
assertNotNull(widget);
assertEquals("My-New-Label", widget.label);
}
@Test
public void testChangeColorPropertyViaGet() throws Exception {
Future<Response> f = httpclient.prepareGet(httpsServerUrl + clientPair.token + "/update/v4?color=%23000000").execute();
Response response = f.get();
assertEquals(200, response.getStatusCode());
verify(clientPair.appClient.responseMock, timeout(500)).channelRead(any(), eq(setProperty(111, "1-0 4 color #000000")));
clientPair.appClient.reset();
clientPair.appClient.send("loadProfileGzipped");
Profile profile = clientPair.appClient.parseProfile(1);
Widget widget = profile.dashBoards[0].findWidgetByPin(0, (short) 4, PinType.VIRTUAL);
assertNotNull(widget);
assertEquals(255, widget.color);
}
@Test
public void testChangeOnLabelPropertyViaGet() throws Exception {
clientPair.appClient.reset();
clientPair.appClient.updateWidget(1, "{\"id\":1, \"width\":1, \"height\":1, \"x\":1, \"y\":1, \"label\":\"Some Text\", \"type\":\"BUTTON\", \"pinType\":\"VIRTUAL\", \"pin\":2, \"value\":\"1\"}");
clientPair.appClient.verifyResult(ok(1));
Future<Response> f = httpclient.prepareGet(httpsServerUrl + clientPair.token + "/update/v2?onLabel=newOnButtonLabel").execute();
Response response = f.get();
assertEquals(200, response.getStatusCode());
verify(clientPair.appClient.responseMock, timeout(500)).channelRead(any(), eq(setProperty(111, "1-0 2 onLabel newOnButtonLabel")));
clientPair.appClient.reset();
clientPair.appClient.send("loadProfileGzipped");
Profile profile = clientPair.appClient.parseProfile(1);
Button button = (Button) profile.dashBoards[0].findWidgetByPin(0, (short) 2, PinType.VIRTUAL);
assertNotNull(button);
assertEquals("newOnButtonLabel", button.onLabel);
}
@Test
public void testChangeOffLabelPropertyViaGet() throws Exception {
clientPair.appClient.reset();
clientPair.appClient.updateWidget(1, "{\"id\":1, \"width\":1, \"height\":1, \"x\":1, \"y\":1, \"label\":\"Some Text\", \"type\":\"BUTTON\", \"pinType\":\"VIRTUAL\", \"pin\":1, \"value\":\"1\"}");
clientPair.appClient.verifyResult(ok(1));
Future<Response> f = httpclient.prepareGet(httpsServerUrl + clientPair.token + "/update/v1?offLabel=newOffButtonLabel").execute();
Response response = f.get();
assertEquals(200, response.getStatusCode());
verify(clientPair.appClient.responseMock, timeout(500)).channelRead(any(), eq(setProperty(111, "1-0 1 offLabel newOffButtonLabel")));
clientPair.appClient.reset();
clientPair.appClient.send("loadProfileGzipped");
Profile profile = clientPair.appClient.parseProfile(1);
Button button = (Button) profile.dashBoards[0].findWidgetByPin(0, (short) 1, PinType.VIRTUAL);
assertNotNull(button);
assertEquals("newOffButtonLabel", button.offLabel);
}
}
================================================
FILE: integration-tests/src/test/java/cc/blynk/integration/http/HttpAPIPinsTest.java
================================================
package cc.blynk.integration.http;
import cc.blynk.integration.SingleServerInstancePerTest;
import cc.blynk.integration.TestUtil;
import cc.blynk.server.api.http.pojo.EmailPojo;
import cc.blynk.server.api.http.pojo.PushMessagePojo;
import cc.blynk.server.core.model.serialization.JsonParser;
import cc.blynk.server.servers.application.MobileAndHttpsServer;
import cc.blynk.server.servers.hardware.HardwareAndHttpAPIServer;
import cc.blynk.utils.properties.ServerProperties;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.junit.MockitoJUnitRunner;
import java.util.Collections;
import java.util.List;
import static cc.blynk.integration.BaseTest.getRelativeDataFolder;
import static cc.blynk.integration.TestUtil.createHolderWithIOMock;
import static org.junit.Assert.assertEquals;
/**
* The Blynk Project.
* Created by Dmitriy Dumanskiy.
* Created on 24.12.15.
*/
@RunWith(MockitoJUnitRunner.class)
public class HttpAPIPinsTest extends SingleServerInstancePerTest {
private static CloseableHttpClient httpclient;
private static String httpsServerUrl;
@BeforeClass
//shadow parent method by purpose
public static void init() throws Exception {
properties = new ServerProperties(Collections.emptyMap());
properties.setProperty("data.folder", getRelativeDataFolder("/profiles"));
holder = createHolderWithIOMock(properties, "no-db.properties");
appServer = new MobileAndHttpsServer(holder).start();
hardwareServer = new HardwareAndHttpAPIServer(holder).start();
httpsServerUrl = String.format("http://localhost:%s/", properties.getHttpPort());
httpclient = HttpClients.createDefault();
}
@AfterClass
public static void closeHttp() throws Exception {
httpclient.close();
}
//----------------------------GET METHODS SECTION
@Test
public void testGetWithFakeToken() throws Exception {
HttpGet request = new HttpGet(httpsServerUrl + "dsadasddasdasdasdasdasdas/get/d8");
try (CloseableHttpResponse response = httpclient.execute(request)) {
assertEquals(400, response.getStatusLine().getStatusCode());
assertEquals("Invalid token.", TestUtil.consumeText(response));
}
}
@Test
public void testGetWithWrongPathToken() throws Exception {
HttpGet request = new HttpGet(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/w/d8");
try (CloseableHttpResponse response = httpclient.execute(request)) {
assertEquals(404, response.getStatusLine().getStatusCode());
}
}
@Test
public void testGetWithWrongPin() throws Exception {
HttpGet request = new HttpGet(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/get/x8");
try (CloseableHttpResponse response = httpclient.execute(request)) {
assertEquals(400, response.getStatusLine().getStatusCode());
assertEquals("Wrong pin format.", TestUtil.consumeText(response));
}
}
@Test
public void testGetWithNonExistingPin() throws Exception {
HttpGet request = new HttpGet(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/get/v11");
try (CloseableHttpResponse response = httpclient.execute(request)) {
assertEquals(400, response.getStatusLine().getStatusCode());
assertEquals("Requested pin doesn't exist in the app.", TestUtil.consumeText(response));
}
}
@Test
public void testGetWringPin() throws Exception {
HttpGet request = new HttpGet(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/get/v256");
try (CloseableHttpResponse response = httpclient.execute(request)) {
assertEquals(400, response.getStatusLine().getStatusCode());
assertEquals("Wrong pin format.", TestUtil.consumeText(response));
}
}
@Test
public void testPutGetNonExistingPin() throws Exception {
HttpPut put = new HttpPut(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/update/v10");
put.setEntity(new StringEntity("[\"100\"]", ContentType.APPLICATION_JSON));
try (CloseableHttpResponse response = httpclient.execute(put)) {
assertEquals(200, response.getStatusLine().getStatusCode());
}
HttpGet get = new HttpGet(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/get/v10");
try (CloseableHttpResponse response = httpclient.execute(get)) {
assertEquals(200, response.getStatusLine().getStatusCode());
List<String> values = TestUtil.consumeJsonPinValues(response);
assertEquals(1, values.size());
assertEquals("100", values.get(0));
}
}
@Test
public void testMultiPutGetNonExistingPin() throws Exception {
HttpPut put = new HttpPut(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/update/v10");
put.setEntity(new StringEntity("[\"100\", \"101\", \"102\"]", ContentType.APPLICATION_JSON));
try (CloseableHttpResponse response = httpclient.execute(put)) {
assertEquals(200, response.getStatusLine().getStatusCode());
}
HttpGet get = new HttpGet(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/get/v10");
try (CloseableHttpResponse response = httpclient.execute(get)) {
assertEquals(200, response.getStatusLine().getStatusCode());
List<String> values = TestUtil.consumeJsonPinValues(response);
assertEquals(3, values.size());
assertEquals("100", values.get(0));
assertEquals("101", values.get(1));
assertEquals("102", values.get(2));
}
}
@Test
public void testMultiPutGetNonExistingPinWithNewMethod() throws Exception {
HttpPut put = new HttpPut(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/update/v10");
put.setEntity(new StringEntity("[\"100\", \"101\", \"102\"]", ContentType.APPLICATION_JSON));
try (CloseableHttpResponse response = httpclient.execute(put)) {
assertEquals(200, response.getStatusLine().getStatusCode());
}
HttpGet get = new HttpGet(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/get/v10");
try (CloseableHttpResponse response = httpclient.execute(get)) {
assertEquals(200, response.getStatusLine().getStatusCode());
List<String> values = TestUtil.consumeJsonPinValues(response);
assertEquals(3, values.size());
assertEquals("100", values.get(0));
assertEquals("101", values.get(1));
assertEquals("102", values.get(2));
}
}
@Test
public void testGetTimerExistingPin() throws Exception {
HttpGet request = new HttpGet(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/get/D0");
try (CloseableHttpResponse response = httpclient.execute(request)) {
assertEquals(200, response.getStatusLine().getStatusCode());
List<String> values = TestUtil.consumeJsonPinValues(response);
assertEquals(1, values.size());
assertEquals("1", values.get(0));
}
}
@Test
public void testGetWithExistingPin() throws Exception {
HttpGet request = new HttpGet(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/get/D8");
try (CloseableHttpResponse response = httpclient.execute(request)) {
assertEquals(200, response.getStatusLine().getStatusCode());
List<String> values = TestUtil.consumeJsonPinValues(response);
assertEquals(1, values.size());
assertEquals("0", values.get(0));
}
request = new HttpGet(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/get/d1");
try (CloseableHttpResponse response = httpclient.execute(request)) {
assertEquals(200, response.getStatusLine().getStatusCode());
List<String> values = TestUtil.consumeJsonPinValues(response);
assertEquals(1, values.size());
assertEquals("1", values.get(0));
}
request = new HttpGet(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/get/d3");
try (CloseableHttpResponse response = httpclient.execute(request)) {
assertEquals(200, response.getStatusLine().getStatusCode());
List<String> values = TestUtil.consumeJsonPinValues(response);
assertEquals(1, values.size());
assertEquals("87", values.get(0));
}
}
@Test
public void testGetWithExistingEmptyPin() throws Exception {
HttpGet request = new HttpGet(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/get/a14");
try (CloseableHttpResponse response = httpclient.execute(request)) {
assertEquals(200, response.getStatusLine().getStatusCode());
List<String> values = TestUtil.consumeJsonPinValues(response);
assertEquals(0, values.size());
}
}
@Test
public void testGetWithExistingMultiPin() throws Exception {
HttpGet request = new HttpGet(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/get/a15");
try (CloseableHttpResponse response = httpclient.execute(request)) {
assertEquals(200, response.getStatusLine().getStatusCode());
List<String> values = TestUtil.consumeJsonPinValues(response);
assertEquals(2, values.size());
assertEquals("1", values.get(0));
assertEquals("2", values.get(1));
}
}
@Test
public void testGetForRGBMerge() throws Exception {
HttpGet request = new HttpGet(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/get/v13");
try (CloseableHttpResponse response = httpclient.execute(request)) {
assertEquals(200, response.getStatusLine().getStatusCode());
List<String> values = TestUtil.consumeJsonPinValues(response);
assertEquals(3, values.size());
assertEquals("60", values.get(0));
assertEquals("143", values.get(1));
assertEquals("158", values.get(2));
}
}
@Test
public void testGetForJoystickMerge() throws Exception {
HttpGet request = new HttpGet(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/get/v14");
try (CloseableHttpResponse response = httpclient.execute(request)) {
assertEquals(200, response.getStatusLine().getStatusCode());
List<String> values = TestUtil.consumeJsonPinValues(response);
assertEquals(2, values.size());
assertEquals("128", values.get(0));
assertEquals("129", values.get(1));
}
}
//----------------------------PUT METHODS SECTION
@Test
public void testPutNoContentType() throws Exception {
HttpPut request = new HttpPut(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/update/d8");
try (CloseableHttpResponse response = httpclient.execute(request)) {
assertEquals(500, response.getStatusLine().getStatusCode());
assertEquals("Unexpected content type. Expecting application/json.", TestUtil.consumeText(response));
}
}
@Test
public void testPutFakeToken() throws Exception {
HttpPut request = new HttpPut(httpsServerUrl + "dsadasddasdasdasdasdasdas/update/d8");
request.setHeader("Content-Type", ContentType.APPLICATION_JSON.toString());
request.setEntity(new StringEntity("[\"100\"]", ContentType.APPLICATION_JSON));
try (CloseableHttpResponse response = httpclient.execute(request)) {
assertEquals(400, response.getStatusLine().getStatusCode());
assertEquals("Invalid token.", TestUtil.consumeText(response));
}
}
@Test
public void testPutWithWrongPin() throws Exception {
HttpPut request = new HttpPut(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/update/x8");
request.setHeader("Content-Type", ContentType.APPLICATION_JSON.toString());
request.setEntity(new StringEntity("[\"100\"]", ContentType.APPLICATION_JSON));
try (CloseableHttpResponse response = httpclient.execute(request)) {
assertEquals(400, response.getStatusLine().getStatusCode());
assertEquals("Wrong pin format.", TestUtil.consumeText(response));
}
}
@Test
public void testPutWithNoWidget() throws Exception {
HttpPut request = new HttpPut(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/update/v10");
request.setHeader("Content-Type", ContentType.APPLICATION_JSON.toString());
request.setEntity(new StringEntity("[\"100\"]", ContentType.APPLICATION_JSON));
try (CloseableHttpResponse response = httpclient.execute(request)) {
assertEquals(200, response.getStatusLine().getStatusCode());
}
}
@Test
public void testPutWithNoWidgetNoPinData() throws Exception {
HttpPut request = new HttpPut(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/update/v10");
request.setHeader("Content-Type", ContentType.APPLICATION_JSON.toString());
request.setEntity(new StringEntity("[]", ContentType.APPLICATION_JSON));
try (CloseableHttpResponse response = httpclient.execute(request)) {
assertEquals(400, response.getStatusLine().getStatusCode());
assertEquals("No pin for update provided.", TestUtil.consumeText(response));
}
}
@Test
public void testPutWithNoWidgetMultivalue() throws Exception {
HttpPut request = new HttpPut(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/update/v10");
request.setHeader("Content-Type", ContentType.APPLICATION_JSON.toString());
request.setEntity(new StringEntity("[\"100\", \"101\", \"102\"]", ContentType.APPLICATION_JSON));
try (CloseableHttpResponse response = httpclient.execute(request)) {
assertEquals(200, response.getStatusLine().getStatusCode());
}
}
@Test
public void testPutWithLargeValueNotAccepted() throws Exception {
HttpPut request = new HttpPut(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/pin/v10");
request.setHeader("Content-Type", ContentType.APPLICATION_JSON.toString());
StringBuilder val = new StringBuilder(512 * 1024);
for (int i = 0; i < val.capacity() / 10; i++) {
val.append("1234567890");
}
val.append("1234567890");
request.setEntity(new StringEntity("[\"" + val.toString() + "\"]", ContentType.APPLICATION_JSON));
try (CloseableHttpResponse response = httpclient.execute(request)) {
assertEquals(413, response.getStatusLine().getStatusCode());
}
}
@Test
public void testPutExtraWithNoWidget() throws Exception {
HttpPut request = new HttpPut(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/extra/pin/v10");
request.setHeader("Content-Type", ContentType.APPLICATION_JSON.toString());
request.setEntity(new StringEntity("[{\"timestamp\" : 123, \"value\":\"100\"}]", ContentType.APPLICATION_JSON));
try (CloseableHttpResponse response = httpclient.execute(request)) {
assertEquals(200, response.getStatusLine().getStatusCode());
}
}
@Test
public void testPutWithExistingPin() throws Exception {
HttpPut request = new HttpPut(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/update/a14");
request.setEntity(new StringEntity("[\"100\"]", ContentType.APPLICATION_JSON));
try (CloseableHttpResponse response = httpclient.execute(request)) {
assertEquals(200, response.getStatusLine().getStatusCode());
}
HttpGet getRequest = new HttpGet(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/get/a14");
try (CloseableHttpResponse response = httpclient.execute(getRequest)) {
assertEquals(200, response.getStatusLine().getStatusCode());
List<String> values = TestUtil.consumeJsonPinValues(response);
assertEquals(1, values.size());
assertEquals("100", values.get(0));
}
}
@Test
public void testPutWithExistingPinWrongBody() throws Exception {
HttpPut request = new HttpPut(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/update/a14");
request.setEntity(new StringEntity("\"100\"", ContentType.APPLICATION_JSON));
try (CloseableHttpResponse response = httpclient.execute(request)) {
assertEquals(500, response.getStatusLine().getStatusCode());
assertEquals("Error parsing body param. \"100\"", TestUtil.consumeText(response));
}
}
@Test
public void testPutWithExistingPinWrongBody2() throws Exception {
HttpPut request = new HttpPut(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/update/a14");
request.setEntity(new StringEntity("", ContentType.APPLICATION_JSON));
try (CloseableHttpResponse response = httpclient.execute(request)) {
assertEquals(500, response.getStatusLine().getStatusCode());
assertEquals("Error parsing body param. ", TestUtil.consumeText(response));
}
}
//----------------------------NOTIFICATION POST METHODS SECTION
//----------------------------pushes
@Test
public void testPostNotifyNoContentType() throws Exception {
HttpPost request = new HttpPost(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/notify");
try (CloseableHttpResponse response = httpclient.execute(request)) {
assertEquals(500, response.getStatusLine().getStatusCode());
assertEquals("Unexpected content type. Expecting application/json.", TestUtil.consumeText(response));
}
}
@Test
public void testPostNotifyNoBody() throws Exception {
HttpPost request = new HttpPost(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/notify");
request.setHeader("Content-Type", ContentType.APPLICATION_JSON.toString());
try (CloseableHttpResponse response = httpclient.execute(request)) {
assertEquals(500, response.getStatusLine().getStatusCode());
assertEquals("Error parsing body param. ", TestUtil.consumeText(response));
}
}
@Test
public void testPostNotifyWithWrongBody() throws Exception {
HttpPost request = new HttpPost(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/notify");
StringBuilder sb = new StringBuilder();
for (int i = 0; i < 256; i++) {
sb.append(i);
}
request.setEntity(new StringEntity("{\"body\":\"" + sb.toString() + "\"}", ContentType.APPLICATION_JSON));
try (CloseableHttpResponse response = httpclient.execute(request)) {
assertEquals(400, response.getStatusLine().getStatusCode());
assertEquals("Body is empty or larger than 255 chars.", TestUtil.consumeText(response));
}
}
@Test
public void testPostNotifyWithBody() throws Exception {
HttpPost request = new HttpPost(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/notify");
String message = JsonParser.MAPPER.writeValueAsString(new PushMessagePojo("This is Push Message"));
request.setEntity(new StringEntity(message, ContentType.APPLICATION_JSON));
try (CloseableHttpResponse response = httpclient.execute(request)) {
assertEquals(200, response.getStatusLine().getStatusCode());
}
}
//----------------------------email
@Test
public void testPostEmailNoContentType() throws Exception {
HttpPost request = new HttpPost(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/email");
try (CloseableHttpResponse response = httpclient.execute(request)) {
assertEquals(500, response.getStatusLine().getStatusCode());
assertEquals("Unexpected content type. Expecting application/json.", TestUtil.consumeText(response));
}
}
@Test
public void testPostEmailNoBody() throws Exception {
HttpPost request = new HttpPost(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/email");
request.setHeader("Content-Type", ContentType.APPLICATION_JSON.toString());
try (CloseableHttpResponse response = httpclient.execute(request)) {
assertEquals(500, response.getStatusLine().getStatusCode());
assertEquals("Error parsing body param. ", TestUtil.consumeText(response));
}
}
@Test
public void testPostEmailWithBody() throws Exception {
HttpPost request = new HttpPost(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/email");
String message = JsonParser.MAPPER.writeValueAsString(new EmailPojo("pupkin@gmail.com", "Title", "Subject"));
request.setEntity(new StringEntity(message, ContentType.APPLICATION_JSON));
try (CloseableHttpResponse response = httpclient.execute(request)) {
assertEquals(200, response.getStatusLine().getStatusCode());
}
}
//------------------------------ SYNC TEST
@Test
public void testSync() throws Exception {
HttpPut request = new HttpPut(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/update/a14");
HttpGet getRequest = new HttpGet(httpsServerUrl + "4ae3851817194e2596cf1b7103603ef8/get/a14");
for (int i = 0; i < 100; i++) {
request.setEntity(new StringEntity("[\""+ i + "\"]", ContentType.APPLICATION_JSON));
try (CloseableHttpResponse response = httpclient.execute(request)) {
assertEquals(200, response.getStatusLine().getStatusCode());
EntityUtils.consume(response.getEntity());
}
try (CloseableHttpResponse response2 = httpclient.execute(getRequest)) {
assertEquals(200, response2.getStatusLine().getStatusCode());
List<String> values = TestUtil.consumeJsonPinValues(response2);
assertEquals(1, values.size());
assertEquals(String.valueOf(i), values.get(0));
}
}
}
}
================================================
FILE: integration-tests/src/test/java/cc/blynk/integration/http/HttpAndTCPSameJVMTest.java
================================================
package cc.blynk.integration.http;
import cc.blynk.integration.SingleServerInstancePerTest;
import cc.blynk.integration.TestUtil;
import cc.blynk.integration.model.tcp.TestHardClient;
import cc.blynk.integration.tcp.EventorTest;
import cc.blynk.server.core.model.DashBoard;
import cc.blynk.server.core.model.DataStream;
import cc.blynk.server.core.model.device.BoardType;
import cc.blynk.server.core.model.device.Device;
import cc.blynk.server.core.model.enums.PinType;
import cc.blynk.server.core.model.widgets.controls.RGB;
import cc.blynk.server.core.model.widgets.controls.Timer;
import cc.blynk.server.core.model.widgets.others.eventor.Eventor;
import cc.blynk.server.core.model.widgets.others.eventor.Rule;
import cc.blynk.server.core.model.widgets.others.eventor.TimerTime;
import cc.blynk.server.core.model.widgets.others.eventor.model.action.BaseAction;
import cc.blynk.server.core.model.widgets.others.eventor.model.action.SetPinAction;
import cc.blynk.server.core.model.widgets.others.eventor.model.action.SetPinActionType;
import cc.blynk.server.core.model.widgets.others.rtc.RTC;
import cc.blynk.server.core.model.widgets.others.webhook.WebHook;
import cc.blynk.server.core.model.widgets.outputs.ValueDisplay;
import cc.blynk.server.core.model.widgets.outputs.graph.GraphDataStream;
import cc.blynk.server.core.model.widgets.outputs.graph.GraphType;
import cc.blynk.server.core.model.widgets.outputs.graph.Superchart;
import cc.blynk.server.core.model.widgets.ui.table.Table;
import cc.blynk.server.servers.application.MobileAndHttpsServer;
import cc.blynk.server.servers.hardware.HardwareAndHttpAPIServer;
import cc.blynk.utils.DateTimeUtils;
import cc.blynk.utils.properties.ServerProperties;
import com.google.zxing.BinaryBitmap;
import com.google.zxing.LuminanceSource;
import com.google.zxing.Result;
import com.google.zxing.client.j2se.BufferedImageLuminanceSource;
import com.google.zxing.common.HybridBinarizer;
import com.google.zxing.qrcode.QRCodeReader;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.junit.MockitoJUnitRunner;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.time.LocalTime;
import java.time.ZoneId;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import static cc.blynk.integration.BaseTest.getRelativeDataFolder;
import static cc.blynk.integration.TestUtil.b;
import static cc.blynk.integration.TestUtil.consumeText;
import static cc.blynk.integration.TestUtil.createDefaultHolder;
import static cc.blynk.integration.TestUtil.createDevice;
import static cc.blynk.integration.TestUtil.hardware;
import static cc.blynk.integration.TestUtil.ok;
import static cc.blynk.server.core.model.enums.PinType.VIRTUAL;
import static cc.blynk.server.core.protocol.enums.Command.HARDWARE;
import static cc.blynk.server.core.protocol.model.messages.MessageFactory.produce;
import static cc.blynk.server.workers.timer.TimerWorker.TIMER_MSG_ID;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.after;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.timeout;
import static org.mockito.Mockito.verify;
/**
* The Blynk Project.
* Created by Dmitriy Dumanskiy.
* Created on 07.01.16.
*/
@RunWith(MockitoJUnitRunner.class)
public class HttpAndTCPSameJVMTest extends SingleServerInstancePerTest {
private static CloseableHttpClient httpclient;
private static String httpServerUrl;
@AfterClass
public static void closeHttp() throws Exception {
httpclient.close();
}
@BeforeClass
//shadow parent method by purpose
public static void init() throws Exception {
properties = new ServerProperties(Collections.emptyMap());
properties.setProperty("data.folder", getRelativeDataFolder("/profiles"));
holder = createDefaultHolder(properties, "no-db.properties");
hardwareServer = new HardwareAndHttpAPIServer(holder).start();
appServer = new MobileAndHttpsServer(holder).start();
httpServerUrl = String.format("http://localhost:%s/", properties.getHttpPort());
httpclient = HttpClients.createDefault();
}
@Test
public void testChangeNonWidgetPinValueViaHardwareAndGetViaHTTP() throws Exception {
clientPair.hardwareClient.send("hardware vw 10 200");
verify(clientPair.appClient.responseMock, timeout(500)).channelRead(any(), eq(produce(1, HARDWARE, b("1-0 vw 10 200"))));
reset(clientPair.appClient.responseMock);
HttpGet request = new HttpGet(httpServerUrl + clientPair.token + "/get/v10");
try (CloseableHttpResponse response = httpclient.execute(request)) {
assertEquals(200, response.getStatusLine().getStatusCode());
List<String> values = TestUtil.consumeJsonPinValues(response);
assertEquals(1, values.size());
assertEquals("200", values.get(0));
}
clientPair.appClient.send("hardware 1 vw 10 201");
verify(clientPair.hardwareClient.responseMock, timeout(500)).channelRead(any(), eq(produce(1, HARDWARE, b("vw 10 201"))));
try (CloseableHttpResponse response = httpclient.execute(request)) {
assertEquals(200, response.getStatusLine().getStatusCode());
List<String> values = TestUtil.consumeJsonPinValues(response);
assertEquals(1, values.size());
assertEquals("201", values.get(0));
}
}
@Test
public void testChangePinValueViaAppAndHardware() throws Exception {
clientPair.hardwareClient.send("hardware vw 4 200");
verify(clientPair.appClient.responseMock, timeout(500)).channelRead(any(), eq(produce(1, HARDWARE, b("1-0 vw 4 200"))));
reset(clientPair.appClient.responseMock);
HttpGet request = new HttpGet(httpServerUrl + clientPair.token + "/get/v4");
try (CloseableHttpResponse response = httpclient.execute(request)) {
assertEquals(200, response.getStatusLine().getStatusCode());
List<String> values = TestUtil.consumeJsonPinValues(response);
assertEquals(1, values.size());
assertEquals("200", values.get(0));
}
clientPair.appClient.send("hardware 1 vw 4 201");
verify(clientPair.hardwareClient.responseMock, timeout(500)).channelRead(any(), eq(produce(1, HARDWARE, b("vw 4 201"))));
try (CloseableHttpResponse response = httpclient.execute(request)) {
assertEquals(200, response.getStatusLine().getStatusCode());
List<String> values = TestUtil.consumeJsonPinValues(response);
assertEquals(1, values.size());
assertEquals("201", values.get(0));
}
}
@Test
public void testRTCWorksViaHttpAPI() throws Exception {
RTC rtc = new RTC();
rtc.id = 434;
rtc.height = 1;
rtc.width = 2;
clientPair.appClient.createWidget(1, rtc);
clientPair.appClient.verifyResult(ok(1));
reset(clientPair.appClient.responseMock);
HttpGet request = new HttpGet(httpServerUrl + clientPair.token + "/rtc");
try (CloseableHttpResponse response = httpclient.execute(request)) {
assertEquals(200, response.getStatusLine().getStatusCode());
List<String> values = TestUtil.consumeJsonPinValues(response);
assertEquals(1, values.size());
}
}
@Test
public void testEventorWorksViaHttpAPI() throws Exception
gitextract_bg4_g3iy/
├── .gitignore
├── .travis.yml
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── README.md
├── apiary.apib
├── checkstyle.xml
├── client/
│ ├── README.md
│ ├── pom.xml
│ └── src/
│ ├── main/
│ │ ├── java/
│ │ │ └── cc/
│ │ │ └── blynk/
│ │ │ └── client/
│ │ │ ├── ClientLauncher.java
│ │ │ ├── CommandParserUtil.java
│ │ │ ├── core/
│ │ │ │ ├── ActiveHardwareClient.java
│ │ │ │ ├── AppClient.java
│ │ │ │ ├── BaseClient.java
│ │ │ │ └── HardwareClient.java
│ │ │ ├── enums/
│ │ │ │ └── ClientMode.java
│ │ │ └── handlers/
│ │ │ ├── ClientReplayingMessageDecoder.java
│ │ │ ├── decoders/
│ │ │ │ ├── AppClientMessageDecoder.java
│ │ │ │ └── ClientMessageDecoder.java
│ │ │ └── hardware/
│ │ │ └── HardwareEchoHandler.java
│ │ └── resources/
│ │ ├── log4j2.xml
│ │ └── test.crt
│ └── test/
│ └── java/
│ └── cc/
│ └── blynk/
│ └── client/
│ └── ClientTest.java
├── docs/
│ ├── README_FOR_APP_DEVS.md
│ └── websocket/
│ ├── Command.js
│ ├── README.MD
│ └── websocket.js.html
├── integration-tests/
│ ├── pom.xml
│ └── src/
│ └── test/
│ ├── java/
│ │ └── cc/
│ │ └── blynk/
│ │ └── integration/
│ │ ├── BaseTest.java
│ │ ├── CounterBase.java
│ │ ├── MyHostVerifier.java
│ │ ├── SingleServerInstancePerTest.java
│ │ ├── SingleServerInstancePerTestWithDB.java
│ │ ├── TestUtil.java
│ │ ├── http/
│ │ │ ├── AcmeTest.java
│ │ │ ├── HttpAPIKeepAliveServerTest.java
│ │ │ ├── HttpAPIPinsAsyncClientTest.java
│ │ │ ├── HttpAPIPinsTest.java
│ │ │ ├── HttpAndTCPSameJVMTest.java
│ │ │ ├── OTATest.java
│ │ │ └── UploadAPITest.java
│ │ ├── https/
│ │ │ ├── HttpResetPassTest.java
│ │ │ └── HttpsAdminServerTest.java
│ │ ├── model/
│ │ │ ├── MockHolder.java
│ │ │ ├── SimpleClientHandler.java
│ │ │ ├── http/
│ │ │ │ ├── PinJsonResponse.java
│ │ │ │ └── ResponseUserEntity.java
│ │ │ ├── tcp/
│ │ │ │ ├── BaseTestAppClient.java
│ │ │ │ ├── BaseTestHardwareClient.java
│ │ │ │ ├── ClientPair.java
│ │ │ │ ├── TestAppClient.java
│ │ │ │ ├── TestHardClient.java
│ │ │ │ └── TestSslHardClient.java
│ │ │ └── websocket/
│ │ │ ├── AppWebSocketClient.java
│ │ │ ├── AppWebSocketClientHandler.java
│ │ │ ├── WebSocketClient.java
│ │ │ └── WebSocketClientHandler.java
│ │ ├── tcp/
│ │ │ ├── AppMailTest.java
│ │ │ ├── AppOfflineTest.java
│ │ │ ├── AppSyncWorkflowTest.java
│ │ │ ├── AppWorkflowTest.java
│ │ │ ├── AssignTokenTest.java
│ │ │ ├── BlynkInternalTest.java
│ │ │ ├── BridgeWorkflowTest.java
│ │ │ ├── CloneWorkFlowTest.java
│ │ │ ├── DeviceCommandsTest.java
│ │ │ ├── DeviceSelectorWorkflowTest.java
│ │ │ ├── DeviceTilesWidgetTest.java
│ │ │ ├── DeviceWorkflowTest.java
│ │ │ ├── EnergyWorkflowTest.java
│ │ │ ├── EventorTest.java
│ │ │ ├── FacebookLoginTest.java
│ │ │ ├── HistoryGraphTest.java
│ │ │ ├── LoadBalancingIntegrationTest.java
│ │ │ ├── MainWorkflowTest.java
│ │ │ ├── MultiAppTest.java
│ │ │ ├── NotificationsLogicTest.java
│ │ │ ├── OfflineNotificationTest.java
│ │ │ ├── PortUnificationTest.java
│ │ │ ├── PublishingPreviewFlow.java
│ │ │ ├── ReadingWorkflowTest.java
│ │ │ ├── RegistrationLimitCheckTest.java
│ │ │ ├── ReportingTest.java
│ │ │ ├── SetPropertyTest.java
│ │ │ ├── ShareProfileWorkflowTest.java
│ │ │ ├── SimplePerformanceTest.java
│ │ │ ├── SyncWorkflowTest.java
│ │ │ ├── TableCommandsTest.java
│ │ │ ├── TagCommandsTest.java
│ │ │ ├── TimerTest.java
│ │ │ ├── WebhookTest.java
│ │ │ └── WidgetWorkflowTest.java
│ │ ├── tools/
│ │ │ ├── FlahsedTokenGenerator.java
│ │ │ ├── ProjectTokenGenerator.java
│ │ │ ├── QRGenerator.java
│ │ │ ├── TokenGenerator.java
│ │ │ └── UserReader.java
│ │ └── websocket/
│ │ └── WebSocketTest.java
│ └── resources/
│ ├── db-test.properties
│ ├── json_test/
│ │ ├── user_profile_json.txt
│ │ ├── user_profile_json_2.txt
│ │ ├── user_profile_json_3_dashes.txt
│ │ ├── user_profile_json_empty_dash.txt
│ │ └── user_profile_json_many_dashes.txt
│ ├── log4j2-test.xml
│ ├── no_certs.properties
│ ├── profiles/
│ │ └── u_dmitriy@blynk.cc.user
│ ├── server.properties
│ ├── server2.properties
│ ├── test-certs/
│ │ └── mutual/
│ │ ├── app.crt
│ │ ├── app.pem
│ │ ├── server.crt
│ │ └── server.pem
│ └── twitter4j.properties
├── license.txt
├── new_server_install.md
├── pom.xml
├── scripts/
│ ├── copy_to_qa.sh
│ ├── db
│ ├── help_tools.sh
│ ├── move.bat
│ ├── move.sh
│ ├── native_openssl.sh
│ ├── ulimit
│ ├── userfull_commands
│ └── win/
│ ├── README.md
│ └── StartBlynkServer.cmd
└── server/
├── Docker/
│ ├── Dockerfile
│ ├── README.md
│ └── bin/
│ └── run.sh
├── acme/
│ ├── pom.xml
│ └── src/
│ └── main/
│ └── java/
│ ├── cc/
│ │ └── blynk/
│ │ └── server/
│ │ └── acme/
│ │ ├── AcmeClient.java
│ │ └── ContentHolder.java
│ └── module-info.java
├── core/
│ ├── pom.xml
│ └── src/
│ ├── main/
│ │ ├── java/
│ │ │ ├── cc/
│ │ │ │ └── blynk/
│ │ │ │ └── server/
│ │ │ │ ├── Holder.java
│ │ │ │ ├── Limits.java
│ │ │ │ ├── SslContextHolder.java
│ │ │ │ ├── TextHolder.java
│ │ │ │ ├── common/
│ │ │ │ │ ├── BaseSimpleChannelInboundHandler.java
│ │ │ │ │ └── handlers/
│ │ │ │ │ ├── AlreadyLoggedHandler.java
│ │ │ │ │ ├── UserNotLoggedHandler.java
│ │ │ │ │ └── logic/
│ │ │ │ │ └── PingLogic.java
│ │ │ │ ├── core/
│ │ │ │ │ ├── BlockingIOProcessor.java
│ │ │ │ │ ├── dao/
│ │ │ │ │ │ ├── CSVGenerator.java
│ │ │ │ │ │ ├── FileManager.java
│ │ │ │ │ │ ├── RegularTokenManager.java
│ │ │ │ │ │ ├── ReportingDiskDao.java
│ │ │ │ │ │ ├── SessionDao.java
│ │ │ │ │ │ ├── SharedTokenManager.java
│ │ │ │ │ │ ├── SharedTokenValue.java
│ │ │ │ │ │ ├── TemporaryTokenValue.java
│ │ │ │ │ │ ├── TokenManager.java
│ │ │ │ │ │ ├── TokenValue.java
│ │ │ │ │ │ ├── UserDao.java
│ │ │ │ │ │ ├── UserKey.java
│ │ │ │ │ │ ├── functions/
│ │ │ │ │ │ │ ├── AverageGraphFunction.java
│ │ │ │ │ │ │ ├── GraphFunction.java
│ │ │ │ │ │ │ ├── MaxGraphFunction.java
│ │ │ │ │ │ │ ├── MedianGraphFunction.java
│ │ │ │ │ │ │ ├── MinGraphFunction.java
│ │ │ │ │ │ │ └── SumGraphFunction.java
│ │ │ │ │ │ └── ota/
│ │ │ │ │ │ ├── OTAInfo.java
│ │ │ │ │ │ └── OTAManager.java
│ │ │ │ │ ├── model/
│ │ │ │ │ │ ├── DashBoard.java
│ │ │ │ │ │ ├── DashboardSettings.java
│ │ │ │ │ │ ├── DataStream.java
│ │ │ │ │ │ ├── Profile.java
│ │ │ │ │ │ ├── auth/
│ │ │ │ │ │ │ ├── App.java
│ │ │ │ │ │ │ ├── FacebookTokenResponse.java
│ │ │ │ │ │ │ ├── Session.java
│ │ │ │ │ │ │ └── User.java
│ │ │ │ │ │ ├── device/
│ │ │ │ │ │ │ ├── BoardType.java
│ │ │ │ │ │ │ ├── ConnectionType.java
│ │ │ │ │ │ │ ├── Device.java
│ │ │ │ │ │ │ ├── DeviceOtaInfo.java
│ │ │ │ │ │ │ ├── DeviceStatusDTO.java
│ │ │ │ │ │ │ ├── HardwareInfo.java
│ │ │ │ │ │ │ ├── HardwareInfoPrivate.java
│ │ │ │ │ │ │ ├── Status.java
│ │ │ │ │ │ │ └── Tag.java
│ │ │ │ │ │ ├── enums/
│ │ │ │ │ │ │ ├── PinMode.java
│ │ │ │ │ │ │ ├── PinType.java
│ │ │ │ │ │ │ ├── ProvisionType.java
│ │ │ │ │ │ │ ├── Theme.java
│ │ │ │ │ │ │ └── WidgetProperty.java
│ │ │ │ │ │ ├── graph/
│ │ │ │ │ │ │ └── GraphKey.java
│ │ │ │ │ │ ├── serialization/
│ │ │ │ │ │ │ ├── CopyUtil.java
│ │ │ │ │ │ │ ├── JsonParser.java
│ │ │ │ │ │ │ └── View.java
│ │ │ │ │ │ ├── storage/
│ │ │ │ │ │ │ ├── DashPinStorageKeyDeserializer.java
│ │ │ │ │ │ │ ├── PinStorageKeyDeserializer.java
│ │ │ │ │ │ │ ├── PinStorageValueDeserializer.java
│ │ │ │ │ │ │ ├── key/
│ │ │ │ │ │ │ │ ├── DashPinPropertyStorageKey.java
│ │ │ │ │ │ │ │ ├── DashPinStorageKey.java
│ │ │ │ │ │ │ │ ├── PinPropertyStorageKey.java
│ │ │ │ │ │ │ │ └── PinStorageKey.java
│ │ │ │ │ │ │ └── value/
│ │ │ │ │ │ │ ├── MultiPinStorageValue.java
│ │ │ │ │ │ │ ├── MultiPinStorageValueType.java
│ │ │ │ │ │ │ ├── PinStorageValue.java
│ │ │ │ │ │ │ └── SinglePinStorageValue.java
│ │ │ │ │ │ └── widgets/
│ │ │ │ │ │ ├── CopyObject.java
│ │ │ │ │ │ ├── DeviceCleaner.java
│ │ │ │ │ │ ├── FrequencyWidget.java
│ │ │ │ │ │ ├── HardwareSyncWidget.java
│ │ │ │ │ │ ├── MobileSyncWidget.java
│ │ │ │ │ │ ├── MultiPinWidget.java
│ │ │ │ │ │ ├── NoPinWidget.java
│ │ │ │ │ │ ├── OnePinReadingWidget.java
│ │ │ │ │ │ ├── OnePinWidget.java
│ │ │ │ │ │ ├── Target.java
│ │ │ │ │ │ ├── Widget.java
│ │ │ │ │ │ ├── controls/
│ │ │ │ │ │ │ ├── Button.java
│ │ │ │ │ │ │ ├── ButtonState.java
│ │ │ │ │ │ │ ├── ButtonStyle.java
│ │ │ │ │ │ │ ├── Edge.java
│ │ │ │ │ │ │ ├── LinkButton.java
│ │ │ │ │ │ │ ├── NumberInput.java
│ │ │ │ │ │ │ ├── QR.java
│ │ │ │ │ │ │ ├── RGB.java
│ │ │ │ │ │ │ ├── SegmentedControl.java
│ │ │ │ │ │ │ ├── Slider.java
│ │ │ │ │ │ │ ├── Step.java
│ │ │ │ │ │ │ ├── StyledButton.java
│ │ │ │ │ │ │ ├── Switch.java
│ │ │ │ │ │ │ ├── Terminal.java
│ │ │ │ │ │ │ ├── TextInput.java
│ │ │ │ │ │ │ ├── Timer.java
│ │ │ │ │ │ │ ├── TwoAxisJoystick.java
│ │ │ │ │ │ │ ├── VerticalSlider.java
│ │ │ │ │ │ │ └── VerticalStep.java
│ │ │ │ │ │ ├── notifications/
│ │ │ │ │ │ │ ├── Mail.java
│ │ │ │ │ │ │ ├── Notification.java
│ │ │ │ │ │ │ ├── SMS.java
│ │ │ │ │ │ │ └── Twitter.java
│ │ │ │ │ │ ├── others/
│ │ │ │ │ │ │ ├── Bluetooth.java
│ │ │ │ │ │ │ ├── BluetoothSerial.java
│ │ │ │ │ │ │ ├── Bridge.java
│ │ │ │ │ │ │ ├── Player.java
│ │ │ │ │ │ │ ├── TextWidget.java
│ │ │ │ │ │ │ ├── Video.java
│ │ │ │ │ │ │ ├── eventor/
│ │ │ │ │ │ │ │ ├── Eventor.java
│ │ │ │ │ │ │ │ ├── Rule.java
│ │ │ │ │ │ │ │ ├── TimerTime.java
│ │ │ │ │ │ │ │ └── model/
│ │ │ │ │ │ │ │ ├── action/
│ │ │ │ │ │ │ │ │ ├── BaseAction.java
│ │ │ │ │ │ │ │ │ ├── SetPinAction.java
│ │ │ │ │ │ │ │ │ ├── SetPinActionType.java
│ │ │ │ │ │ │ │ │ ├── SetPropertyPinAction.java
│ │ │ │ │ │ │ │ │ └── notification/
│ │ │ │ │ │ │ │ │ ├── MailAction.java
│ │ │ │ │ │ │ │ │ ├── NotificationAction.java
│ │ │ │ │ │ │ │ │ ├── NotifyAction.java
│ │ │ │ │ │ │ │ │ └── TwitAction.java
│ │ │ │ │ │ │ │ └── condition/
│ │ │ │ │ │ │ │ ├── BaseCondition.java
│ │ │ │ │ │ │ │ ├── ValueChanged.java
│ │ │ │ │ │ │ │ ├── number/
│ │ │ │ │ │ │ │ │ ├── Between.java
│ │ │ │ │ │ │ │ │ ├── Equal.java
│ │ │ │ │ │ │ │ │ ├── GreaterThan.java
│ │ │ │ │ │ │ │ │ ├── GreaterThanOrEqual.java
│ │ │ │ │ │ │ │ │ ├── LessThan.java
│ │ │ │ │ │ │ │ │ ├── LessThanOrEqual.java
│ │ │ │ │ │ │ │ │ ├── NotBetween.java
│ │ │ │ │ │ │ │ │ └── NotEqual.java
│ │ │ │ │ │ │ │ └── string/
│ │ │ │ │ │ │ │ ├── StringEqual.java
│ │ │ │ │ │ │ │ └── StringNotEqual.java
│ │ │ │ │ │ │ ├── rtc/
│ │ │ │ │ │ │ │ ├── RTC.java
│ │ │ │ │ │ │ │ ├── StringToZoneId.java
│ │ │ │ │ │ │ │ └── ZoneIdToString.java
│ │ │ │ │ │ │ └── webhook/
│ │ │ │ │ │ │ ├── Header.java
│ │ │ │ │ │ │ ├── SupportedWebhookMethod.java
│ │ │ │ │ │ │ └── WebHook.java
│ │ │ │ │ │ ├── outputs/
│ │ │ │ │ │ │ ├── Gauge.java
│ │ │ │ │ │ │ ├── LCD.java
│ │ │ │ │ │ │ ├── LED.java
│ │ │ │ │ │ │ ├── LabeledValueDisplay.java
│ │ │ │ │ │ │ ├── LevelDisplay.java
│ │ │ │ │ │ │ ├── Map.java
│ │ │ │ │ │ │ ├── TextAlignment.java
│ │ │ │ │ │ │ ├── ValueDisplay.java
│ │ │ │ │ │ │ ├── VerticalLevelDisplay.java
│ │ │ │ │ │ │ └── graph/
│ │ │ │ │ │ │ ├── AggregationFunctionType.java
│ │ │ │ │ │ │ ├── FontSize.java
│ │ │ │ │ │ │ ├── GoalLine.java
│ │ │ │ │ │ │ ├── GraphDataStream.java
│ │ │ │ │ │ │ ├── GraphGranularityType.java
│ │ │ │ │ │ │ ├── GraphPeriod.java
│ │ │ │ │ │ │ ├── GraphType.java
│ │ │ │ │ │ │ ├── LineType.java
│ │ │ │ │ │ │ ├── Stacking.java
│ │ │ │ │ │ │ ├── Superchart.java
│ │ │ │ │ │ │ └── YAxisScale.java
│ │ │ │ │ │ ├── sensors/
│ │ │ │ │ │ │ ├── Accelerometer.java
│ │ │ │ │ │ │ ├── Barometer.java
│ │ │ │ │ │ │ ├── GPSStreaming.java
│ │ │ │ │ │ │ ├── GPSTrigger.java
│ │ │ │ │ │ │ ├── Gravity.java
│ │ │ │ │ │ │ ├── Humidity.java
│ │ │ │ │ │ │ ├── Light.java
│ │ │ │ │ │ │ ├── Proximity.java
│ │ │ │ │ │ │ └── Temperature.java
│ │ │ │ │ │ └── ui/
│ │ │ │ │ │ ├── DeviceSelector.java
│ │ │ │ │ │ ├── Menu.java
│ │ │ │ │ │ ├── Tab.java
│ │ │ │ │ │ ├── Tabs.java
│ │ │ │ │ │ ├── TimeInput.java
│ │ │ │ │ │ ├── image/
│ │ │ │ │ │ │ ├── Image.java
│ │ │ │ │ │ │ ├── ImageScaling.java
│ │ │ │ │ │ │ └── ImageSource.java
│ │ │ │ │ │ ├── reporting/
│ │ │ │ │ │ │ ├── BaseReportTask.java
│ │ │ │ │ │ │ ├── Format.java
│ │ │ │ │ │ │ ├── PeriodicReportTask.java
│ │ │ │ │ │ │ ├── Report.java
│ │ │ │ │ │ │ ├── ReportOutput.java
│ │ │ │ │ │ │ ├── ReportResult.java
│ │ │ │ │ │ │ ├── ReportScheduler.java
│ │ │ │ │ │ │ ├── ReportTaskKey.java
│ │ │ │ │ │ │ ├── ReportingWidget.java
│ │ │ │ │ │ │ ├── source/
│ │ │ │ │ │ │ │ ├── DeviceReportSource.java
│ │ │ │ │ │ │ │ ├── ReportDataStream.java
│ │ │ │ │ │ │ │ ├── ReportSource.java
│ │ │ │ │ │ │ │ └── TileTemplateReportSource.java
│ │ │ │ │ │ │ └── type/
│ │ │ │ │ │ │ ├── BaseReportType.java
│ │ │ │ │ │ │ ├── DailyReport.java
│ │ │ │ │ │ │ ├── DayOfMonth.java
│ │ │ │ │ │ │ ├── MonthlyReport.java
│ │ │ │ │ │ │ ├── OneTimeReport.java
│ │ │ │ │ │ │ ├── ReportDurationType.java
│ │ │ │ │ │ │ └── WeeklyReport.java
│ │ │ │ │ │ ├── table/
│ │ │ │ │ │ │ ├── Column.java
│ │ │ │ │ │ │ ├── Row.java
│ │ │ │ │ │ │ └── Table.java
│ │ │ │ │ │ └── tiles/
│ │ │ │ │ │ ├── DeviceTiles.java
│ │ │ │ │ │ ├── SortType.java
│ │ │ │ │ │ ├── Tile.java
│ │ │ │ │ │ ├── TileMode.java
│ │ │ │ │ │ ├── TileTemplate.java
│ │ │ │ │ │ └── templates/
│ │ │ │ │ │ ├── ButtonTileTemplate.java
│ │ │ │ │ │ ├── DimmerTileTemplate.java
│ │ │ │ │ │ ├── Interaction.java
│ │ │ │ │ │ ├── PageTileTemplate.java
│ │ │ │ │ │ └── State.java
│ │ │ │ │ ├── processors/
│ │ │ │ │ │ ├── BaseProcessorHandler.java
│ │ │ │ │ │ ├── EventorProcessor.java
│ │ │ │ │ │ ├── NotificationBase.java
│ │ │ │ │ │ └── WebhookProcessor.java
│ │ │ │ │ ├── protocol/
│ │ │ │ │ │ ├── enums/
│ │ │ │ │ │ │ ├── Command.java
│ │ │ │ │ │ │ └── Response.java
│ │ │ │ │ │ ├── exceptions/
│ │ │ │ │ │ │ ├── BaseServerException.java
│ │ │ │ │ │ │ ├── IllegalCommandBodyException.java
│ │ │ │ │ │ │ ├── IllegalCommandException.java
│ │ │ │ │ │ │ ├── NoDataException.java
│ │ │ │ │ │ │ ├── NotAllowedException.java
│ │ │ │ │ │ │ ├── QuotaLimitException.java
│ │ │ │ │ │ │ └── UnsupportedCommandException.java
│ │ │ │ │ │ ├── handlers/
│ │ │ │ │ │ │ ├── DefaultExceptionHandler.java
│ │ │ │ │ │ │ ├── decoders/
│ │ │ │ │ │ │ │ ├── MessageDecoder.java
│ │ │ │ │ │ │ │ ├── MobileMessageDecoder.java
│ │ │ │ │ │ │ │ └── WSMessageDecoder.java
│ │ │ │ │ │ │ └── encoders/
│ │ │ │ │ │ │ ├── MessageEncoder.java
│ │ │ │ │ │ │ ├── MobileMessageEncoder.java
│ │ │ │ │ │ │ └── WSMessageEncoder.java
│ │ │ │ │ │ └── model/
│ │ │ │ │ │ └── messages/
│ │ │ │ │ │ ├── BinaryMessage.java
│ │ │ │ │ │ ├── MessageBase.java
│ │ │ │ │ │ ├── MessageFactory.java
│ │ │ │ │ │ ├── ResponseMessage.java
│ │ │ │ │ │ ├── StringMessage.java
│ │ │ │ │ │ ├── appllication/
│ │ │ │ │ │ │ ├── GetServerMessage.java
│ │ │ │ │ │ │ ├── LoginMessage.java
│ │ │ │ │ │ │ ├── RegisterMessage.java
│ │ │ │ │ │ │ ├── ResetPasswordMessage.java
│ │ │ │ │ │ │ └── sharing/
│ │ │ │ │ │ │ └── ShareLoginMessage.java
│ │ │ │ │ │ ├── common/
│ │ │ │ │ │ │ └── HardwareMessage.java
│ │ │ │ │ │ └── hardware/
│ │ │ │ │ │ └── HardwareLoginMessage.java
│ │ │ │ │ ├── reporting/
│ │ │ │ │ │ ├── GraphPinRequest.java
│ │ │ │ │ │ ├── average/
│ │ │ │ │ │ │ ├── AggregationKey.java
│ │ │ │ │ │ │ ├── AggregationValue.java
│ │ │ │ │ │ │ └── AverageAggregatorProcessor.java
│ │ │ │ │ │ └── raw/
│ │ │ │ │ │ ├── BaseReportingKey.java
│ │ │ │ │ │ ├── GraphValue.java
│ │ │ │ │ │ ├── RawDataCacheForGraphProcessor.java
│ │ │ │ │ │ └── RawDataProcessor.java
│ │ │ │ │ ├── session/
│ │ │ │ │ │ ├── HardwareStateHolder.java
│ │ │ │ │ │ └── StateHolderBase.java
│ │ │ │ │ └── stats/
│ │ │ │ │ ├── EWMA.java
│ │ │ │ │ ├── GlobalStats.java
│ │ │ │ │ ├── Meter.java
│ │ │ │ │ ├── metrics/
│ │ │ │ │ │ └── InstanceLoadMeter.java
│ │ │ │ │ └── model/
│ │ │ │ │ ├── BlockingIOStat.java
│ │ │ │ │ ├── CommandStat.java
│ │ │ │ │ ├── HttpStat.java
│ │ │ │ │ ├── MemoryStat.java
│ │ │ │ │ └── Stat.java
│ │ │ │ ├── db/
│ │ │ │ │ ├── DBManager.java
│ │ │ │ │ ├── ReportingDBManager.java
│ │ │ │ │ ├── dao/
│ │ │ │ │ │ ├── CloneProjectDBDao.java
│ │ │ │ │ │ ├── FlashedTokensDBDao.java
│ │ │ │ │ │ ├── ForwardingTokenDBDao.java
│ │ │ │ │ │ ├── ForwardingTokenEntry.java
│ │ │ │ │ │ ├── PurchaseDBDao.java
│ │ │ │ │ │ ├── RedeemDBDao.java
│ │ │ │ │ │ ├── ReportingDBDao.java
│ │ │ │ │ │ └── UserDBDao.java
│ │ │ │ │ └── model/
│ │ │ │ │ ├── FlashedToken.java
│ │ │ │ │ ├── Purchase.java
│ │ │ │ │ └── Redeem.java
│ │ │ │ ├── internal/
│ │ │ │ │ ├── CommonByteBufUtil.java
│ │ │ │ │ ├── EmptyArraysUtil.java
│ │ │ │ │ ├── QuotaLimitChecker.java
│ │ │ │ │ ├── ReregisterChannelUtil.java
│ │ │ │ │ ├── SerializationUtil.java
│ │ │ │ │ ├── StateHolderUtil.java
│ │ │ │ │ └── token/
│ │ │ │ │ ├── BaseToken.java
│ │ │ │ │ ├── ResetPassToken.java
│ │ │ │ │ └── TokensPool.java
│ │ │ │ ├── transport/
│ │ │ │ │ └── TransportTypeHolder.java
│ │ │ │ └── workers/
│ │ │ │ ├── ReadingWidgetsWorker.java
│ │ │ │ └── timer/
│ │ │ │ ├── TimerKey.java
│ │ │ │ └── TimerWorker.java
│ │ │ └── module-info.java
│ │ └── resources/
│ │ ├── create_schema.sql
│ │ ├── db.properties
│ │ ├── dynamic_provisioning_mail.html
│ │ ├── migrataion.temp
│ │ ├── reporting_schema.sql
│ │ ├── server.properties
│ │ ├── single_token_mail_body.txt
│ │ ├── static_provisioning_mail.html
│ │ └── template_id_mail.html
│ └── test/
│ ├── java/
│ │ └── cc/
│ │ └── blynk/
│ │ ├── server/
│ │ │ ├── core/
│ │ │ │ ├── dao/
│ │ │ │ │ ├── CSVGeneratorTest.java
│ │ │ │ │ ├── ReportingDaoTest.java
│ │ │ │ │ └── functions/
│ │ │ │ │ └── MedianGraphFunctionTest.java
│ │ │ │ ├── device/
│ │ │ │ │ └── SerializationForBoardTypeTest.java
│ │ │ │ ├── model/
│ │ │ │ │ ├── CopyObjectTest.java
│ │ │ │ │ ├── DataStreamStorageSerializationTest.java
│ │ │ │ │ ├── DataStreamValuesUpdateCorrectTest.java
│ │ │ │ │ └── widgets/
│ │ │ │ │ ├── DataStreamGetJsonValueTest.java
│ │ │ │ │ ├── MultiPinWidgetsToJsonTest.java
│ │ │ │ │ ├── others/
│ │ │ │ │ │ └── RTCSerializationTest.java
│ │ │ │ │ └── ui/
│ │ │ │ │ ├── TableSerializationTest.java
│ │ │ │ │ └── reporting/
│ │ │ │ │ └── ReportingModelTest.java
│ │ │ │ └── reporting/
│ │ │ │ └── average/
│ │ │ │ └── AverageAggregatorTest.java
│ │ │ ├── db/
│ │ │ │ ├── CloneProjectTest.java
│ │ │ │ ├── DBManagerTest.java
│ │ │ │ ├── FlashedTokensManagerTest.java
│ │ │ │ ├── ForwardingTokenTest.java
│ │ │ │ ├── RawDataDBTest.java
│ │ │ │ └── RealtimeStatsDBTest.java
│ │ │ └── internal/
│ │ │ └── SerializationTokenPoolTest.java
│ │ └── test/
│ │ └── utils/
│ │ ├── FileManagerIntegrationTest.java
│ │ ├── JsonParsingTest.java
│ │ ├── NumberUtilTest.java
│ │ ├── StringUtilPerfTest.java
│ │ ├── StringUtilsTest.java
│ │ └── UserStatisticsTest.java
│ └── resources/
│ ├── db-test.properties
│ ├── json_test/
│ │ ├── user_ios_profile_json.txt
│ │ ├── user_profile_json.txt
│ │ ├── user_profile_json_2.txt
│ │ ├── user_profile_json_3.txt
│ │ ├── user_profile_json_4.txt
│ │ ├── user_profile_json_5.txt
│ │ ├── user_profile_json_RGB.txt
│ │ ├── user_profile_json_old_pinstorage.txt
│ │ ├── user_profile_json_with_outdated_widget.txt
│ │ └── user_profile_with_timer.txt
│ └── log4j2-test.xml
├── http-admin/
│ ├── pom.xml
│ └── src/
│ ├── main/
│ │ ├── java/
│ │ │ ├── cc/
│ │ │ │ └── blynk/
│ │ │ │ └── server/
│ │ │ │ └── admin/
│ │ │ │ └── http/
│ │ │ │ ├── handlers/
│ │ │ │ │ └── IpFilterHandler.java
│ │ │ │ ├── logic/
│ │ │ │ │ ├── Config.java
│ │ │ │ │ ├── ConfigsLogic.java
│ │ │ │ │ ├── HardwareStatsLogic.java
│ │ │ │ │ ├── OTALogic.java
│ │ │ │ │ ├── StatsLogic.java
│ │ │ │ │ └── UsersLogic.java
│ │ │ │ └── response/
│ │ │ │ ├── IpNameResponse.java
│ │ │ │ └── RequestPerSecondResponse.java
│ │ │ └── module-info.java
│ │ └── resources/
│ │ └── static/
│ │ ├── admin.html
│ │ ├── css/
│ │ │ └── blynk.css
│ │ ├── js/
│ │ │ ├── admin.js
│ │ │ ├── core-min.js
│ │ │ ├── enc-base64-min.js
│ │ │ ├── login.js
│ │ │ └── sha256-min.js
│ │ └── login.html
│ └── test/
│ └── java/
│ └── cc/
│ └── blynk/
│ └── server/
│ ├── admin/
│ │ └── http/
│ │ ├── handlers/
│ │ │ └── IpFilterHandlerTest.java
│ │ └── logic/
│ │ └── admin/
│ │ └── UsersLogicTest.java
│ └── reset/
│ └── SHA256UtilTest.java
├── http-api/
│ ├── pom.xml
│ └── src/
│ ├── main/
│ │ ├── java/
│ │ │ └── cc/
│ │ │ └── blynk/
│ │ │ └── server/
│ │ │ └── api/
│ │ │ ├── http/
│ │ │ │ ├── handlers/
│ │ │ │ │ ├── BaseHttpAndBlynkUnificationHandler.java
│ │ │ │ │ ├── BaseWebSocketUnificator.java
│ │ │ │ │ └── LetsEncryptHandler.java
│ │ │ │ ├── logic/
│ │ │ │ │ ├── HttpAPILogic.java
│ │ │ │ │ ├── ResetPasswordHttpLogic.java
│ │ │ │ │ └── business/
│ │ │ │ │ ├── AdminAuthHandler.java
│ │ │ │ │ └── AuthCookieHandler.java
│ │ │ │ └── pojo/
│ │ │ │ ├── EmailPojo.java
│ │ │ │ ├── PinData.java
│ │ │ │ └── PushMessagePojo.java
│ │ │ └── websockets/
│ │ │ └── handlers/
│ │ │ ├── WSHandler.java
│ │ │ └── WSWrapperEncoder.java
│ │ └── resources/
│ │ └── static/
│ │ └── reset/
│ │ ├── enterNewPassword.html
│ │ ├── reset-email-app-confirmation.html
│ │ ├── reset-email-app.html
│ │ ├── reset-email.html
│ │ └── site.css
│ └── test/
│ └── java/
│ └── cc/
│ └── blynk/
│ └── server/
│ ├── api/
│ │ └── http/
│ │ ├── logic/
│ │ │ ├── HttpSignatureTest.java
│ │ │ └── TestHideSecureInfoForCloning.java
│ │ └── pojo/
│ │ └── TestDataStreamDataJson.java
│ └── reset/
│ └── TokensPoolTest.java
├── http-core/
│ ├── pom.xml
│ └── src/
│ ├── main/
│ │ └── java/
│ │ ├── cc/
│ │ │ └── blynk/
│ │ │ └── core/
│ │ │ └── http/
│ │ │ ├── AnnotationsProcessor.java
│ │ │ ├── AuthHeadersBaseHttpHandler.java
│ │ │ ├── BaseHttpHandler.java
│ │ │ ├── CookiesBaseHttpHandler.java
│ │ │ ├── Response.java
│ │ │ ├── TokenBaseHttpHandler.java
│ │ │ ├── UriTemplate.java
│ │ │ ├── annotation/
│ │ │ │ ├── Consumes.java
│ │ │ │ ├── Context.java
│ │ │ │ ├── DELETE.java
│ │ │ │ ├── EnumQueryParam.java
│ │ │ │ ├── FormParam.java
│ │ │ │ ├── GET.java
│ │ │ │ ├── HttpMethod.java
│ │ │ │ ├── Metric.java
│ │ │ │ ├── POST.java
│ │ │ │ ├── PUT.java
│ │ │ │ ├── Path.java
│ │ │ │ ├── PathParam.java
│ │ │ │ └── QueryParam.java
│ │ │ ├── handlers/
│ │ │ │ ├── BlynkHttpPostMultipartRequestDecoder.java
│ │ │ │ ├── BlynkHttpPostRequestDecoder.java
│ │ │ │ ├── CookieBasedUrlReWriterHandler.java
│ │ │ │ ├── HttpPostBodyUtil.java
│ │ │ │ ├── NoCacheStaticFile.java
│ │ │ │ ├── NoMatchHandler.java
│ │ │ │ ├── OTAHandler.java
│ │ │ │ ├── StaticFile.java
│ │ │ │ ├── StaticFileEdsWith.java
│ │ │ │ ├── StaticFileHandler.java
│ │ │ │ ├── UploadHandler.java
│ │ │ │ └── url/
│ │ │ │ ├── UrlMapper.java
│ │ │ │ └── UrlReWriterHandler.java
│ │ │ ├── model/
│ │ │ │ ├── Filter.java
│ │ │ │ └── NameCountResponse.java
│ │ │ ├── rest/
│ │ │ │ ├── HandlerHolder.java
│ │ │ │ ├── HandlerWrapper.java
│ │ │ │ ├── RequestHeaderParam.java
│ │ │ │ ├── URIDecoder.java
│ │ │ │ └── params/
│ │ │ │ ├── BodyParam.java
│ │ │ │ ├── ContextParam.java
│ │ │ │ ├── EnumQueryParam.java
│ │ │ │ ├── FormParam.java
│ │ │ │ ├── Param.java
│ │ │ │ ├── PathParam.java
│ │ │ │ └── QueryParam.java
│ │ │ └── utils/
│ │ │ ├── AdminHttpUtil.java
│ │ │ ├── ContentTypeUtil.java
│ │ │ └── ListUtils.java
│ │ └── module-info.java
│ └── test/
│ └── java/
│ └── cc/
│ └── blynk/
│ ├── core/
│ │ └── http/
│ │ └── UriTemplateTest.java
│ └── test/
│ └── ListUtilsTest.java
├── launcher/
│ ├── pom.xml
│ └── src/
│ ├── main/
│ │ ├── java/
│ │ │ └── cc/
│ │ │ └── blynk/
│ │ │ ├── cli/
│ │ │ │ ├── AlreadySelectedException.java
│ │ │ │ ├── AmbiguousOptionException.java
│ │ │ │ ├── CommandLine.java
│ │ │ │ ├── DefaultParser.java
│ │ │ │ ├── MissingArgumentException.java
│ │ │ │ ├── MissingOptionException.java
│ │ │ │ ├── Option.java
│ │ │ │ ├── OptionGroup.java
│ │ │ │ ├── OptionValidator.java
│ │ │ │ ├── Options.java
│ │ │ │ ├── ParseException.java
│ │ │ │ ├── UnrecognizedOptionException.java
│ │ │ │ └── Util.java
│ │ │ ├── server/
│ │ │ │ ├── launcher/
│ │ │ │ │ ├── ArgumentsParser.java
│ │ │ │ │ ├── JobLauncher.java
│ │ │ │ │ └── ServerLauncher.java
│ │ │ │ ├── servers/
│ │ │ │ │ ├── BaseServer.java
│ │ │ │ │ ├── application/
│ │ │ │ │ │ └── MobileAndHttpsServer.java
│ │ │ │ │ └── hardware/
│ │ │ │ │ ├── HardwareAndHttpAPIServer.java
│ │ │ │ │ └── MQTTHardwareServer.java
│ │ │ │ └── workers/
│ │ │ │ ├── CertificateRenewalWorker.java
│ │ │ │ ├── HistoryGraphUnusedPinDataCleanerWorker.java
│ │ │ │ ├── ProfileSaverWorker.java
│ │ │ │ ├── ReportingTruncateWorker.java
│ │ │ │ ├── ReportingWorker.java
│ │ │ │ ├── ShutdownHookWorker.java
│ │ │ │ └── StatsWorker.java
│ │ │ └── utils/
│ │ │ └── LoggerUtil.java
│ │ └── resources/
│ │ └── log4j2.xml
│ └── test/
│ └── java/
│ └── cc/
│ └── blynk/
│ └── server/
│ └── workers/
│ ├── ProfileSaverWorkerTest.java
│ └── ReportingWorkerTest.java
├── notifications/
│ ├── email/
│ │ ├── pom.xml
│ │ └── src/
│ │ ├── main/
│ │ │ ├── java/
│ │ │ │ ├── cc/
│ │ │ │ │ └── blynk/
│ │ │ │ │ └── server/
│ │ │ │ │ └── notifications/
│ │ │ │ │ └── mail/
│ │ │ │ │ ├── GMailClient.java
│ │ │ │ │ ├── MailClient.java
│ │ │ │ │ ├── MailWrapper.java
│ │ │ │ │ ├── QrHolder.java
│ │ │ │ │ ├── ResetQrHolder.java
│ │ │ │ │ └── ThirdPartyMailClient.java
│ │ │ │ └── module-info.java
│ │ │ └── resources/
│ │ │ └── mail.properties
│ │ └── test/
│ │ ├── java/
│ │ │ └── cc/
│ │ │ └── blynk/
│ │ │ └── server/
│ │ │ └── notifications/
│ │ │ └── mail/
│ │ │ └── MailWrapperTest.java
│ │ └── resources/
│ │ ├── amazon.properties
│ │ ├── mail.properties
│ │ ├── sparkpost-http.properties
│ │ └── sparkpost-smtp.properties
│ ├── pom.xml
│ ├── push/
│ │ ├── pom.xml
│ │ └── src/
│ │ ├── main/
│ │ │ ├── java/
│ │ │ │ ├── cc/
│ │ │ │ │ └── blynk/
│ │ │ │ │ └── server/
│ │ │ │ │ └── notifications/
│ │ │ │ │ └── push/
│ │ │ │ │ ├── GCMMessage.java
│ │ │ │ │ ├── GCMResponseMessage.java
│ │ │ │ │ ├── GCMResult.java
│ │ │ │ │ ├── GCMWrapper.java
│ │ │ │ │ ├── android/
│ │ │ │ │ │ ├── AndroidBody.java
│ │ │ │ │ │ └── AndroidGCMMessage.java
│ │ │ │ │ ├── enums/
│ │ │ │ │ │ └── Priority.java
│ │ │ │ │ └── ios/
│ │ │ │ │ ├── IOSBody.java
│ │ │ │ │ └── IOSGCMMessage.java
│ │ │ │ └── module-info.java
│ │ │ └── resources/
│ │ │ └── gcm.properties
│ │ └── test/
│ │ └── java/
│ │ └── cc/
│ │ └── blynk/
│ │ └── server/
│ │ └── notifications/
│ │ └── push/
│ │ └── GCMWrapperTest.java
│ ├── sms/
│ │ ├── pom.xml
│ │ └── src/
│ │ ├── main/
│ │ │ ├── java/
│ │ │ │ ├── cc/
│ │ │ │ │ └── blynk/
│ │ │ │ │ └── server/
│ │ │ │ │ └── notifications/
│ │ │ │ │ └── sms/
│ │ │ │ │ ├── SMSWrapper.java
│ │ │ │ │ └── SmsResponse.java
│ │ │ │ └── module-info.java
│ │ │ └── resources/
│ │ │ └── sms.properties
│ │ └── test/
│ │ └── java/
│ │ └── cc/
│ │ └── blynk/
│ │ └── server/
│ │ └── notifications/
│ │ └── sms/
│ │ └── TestSendSms.java
│ └── twitter/
│ ├── pom.xml
│ └── src/
│ ├── main/
│ │ └── java/
│ │ ├── cc/
│ │ │ └── blynk/
│ │ │ └── server/
│ │ │ └── notifications/
│ │ │ └── twitter/
│ │ │ └── TwitterWrapper.java
│ │ └── module-info.java
│ └── test/
│ ├── java/
│ │ └── cc/
│ │ └── blynk/
│ │ └── server/
│ │ └── notifications/
│ │ └── twitter/
│ │ └── TwitterWrapperTest.java
│ └── resources/
│ └── twitter4j.properties
├── pom.xml
├── tcp-app-server/
│ ├── pom.xml
│ └── src/
│ ├── main/
│ │ ├── java/
│ │ │ └── cc/
│ │ │ └── blynk/
│ │ │ ├── server/
│ │ │ │ └── application/
│ │ │ │ └── handlers/
│ │ │ │ ├── main/
│ │ │ │ │ ├── MobileChannelStateHandler.java
│ │ │ │ │ ├── MobileHandler.java
│ │ │ │ │ ├── MobileResetPasswordHandler.java
│ │ │ │ │ ├── auth/
│ │ │ │ │ │ ├── LimitChecker.java
│ │ │ │ │ │ ├── MobileGetServerHandler.java
│ │ │ │ │ │ ├── MobileLoginHandler.java
│ │ │ │ │ │ ├── MobileRegisterHandler.java
│ │ │ │ │ │ ├── MobileStateHolder.java
│ │ │ │ │ │ ├── OsType.java
│ │ │ │ │ │ └── Version.java
│ │ │ │ │ └── logic/
│ │ │ │ │ ├── LoadSharedProfileGzippedLogic.java
│ │ │ │ │ ├── MobileActivateDashboardLogic.java
│ │ │ │ │ ├── MobileAddPushLogic.java
│ │ │ │ │ ├── MobileAssignTokenLogic.java
│ │ │ │ │ ├── MobileDeActivateDashboardLogic.java
│ │ │ │ │ ├── MobileGetCloneCodeLogic.java
│ │ │ │ │ ├── MobileGetEnergyLogic.java
│ │ │ │ │ ├── MobileGetProjectByClonedTokenLogic.java
│ │ │ │ │ ├── MobileGetProjectByTokenLogic.java
│ │ │ │ │ ├── MobileGetProvisionTokenLogic.java
│ │ │ │ │ ├── MobileHardwareLogic.java
│ │ │ │ │ ├── MobileHardwareResendFromBTLogic.java
│ │ │ │ │ ├── MobileLoadProfileGzippedLogic.java
│ │ │ │ │ ├── MobileLogoutLogic.java
│ │ │ │ │ ├── MobileMailLogic.java
│ │ │ │ │ ├── MobilePurchaseLogic.java
│ │ │ │ │ ├── MobileRedeemLogic.java
│ │ │ │ │ ├── MobileRefreshTokenLogic.java
│ │ │ │ │ ├── MobileSetWidgetPropertyLogic.java
│ │ │ │ │ ├── MobileSyncLogic.java
│ │ │ │ │ ├── dashboard/
│ │ │ │ │ │ ├── MobileCreateDashLogic.java
│ │ │ │ │ │ ├── MobileDeleteDashLogic.java
│ │ │ │ │ │ ├── MobileUpdateDashLogic.java
│ │ │ │ │ │ ├── MobileUpdateDashSettingLogic.java
│ │ │ │ │ │ ├── device/
│ │ │ │ │ │ │ ├── MobileCreateDeviceLogic.java
│ │ │ │ │ │ │ ├── MobileDeleteDeviceLogic.java
│ │ │ │ │ │ │ ├── MobileGetDeviceLogic.java
│ │ │ │ │ │ │ ├── MobileGetDevicesLogic.java
│ │ │ │ │ │ │ └── MobileUpdateDeviceLogic.java
│ │ │ │ │ │ ├── tags/
│ │ │ │ │ │ │ ├── MobileCreateTagLogic.java
│ │ │ │ │ │ │ ├── MobileDeleteTagLogic.java
│ │ │ │ │ │ │ ├── MobileGetTagsLogic.java
│ │ │ │ │ │ │ └── MobileUpdateTagLogic.java
│ │ │ │ │ │ └── widget/
│ │ │ │ │ │ ├── MobileCreateWidgetLogic.java
│ │ │ │ │ │ ├── MobileDeleteWidgetLogic.java
│ │ │ │ │ │ ├── MobileGetWidgetLogic.java
│ │ │ │ │ │ ├── MobileUpdateWidgetLogic.java
│ │ │ │ │ │ └── tile/
│ │ │ │ │ │ ├── MobileCreateTileTemplateLogic.java
│ │ │ │ │ │ ├── MobileDeleteTileTemplateLogic.java
│ │ │ │ │ │ └── MobileUpdateTileTemplateLogic.java
│ │ │ │ │ ├── face/
│ │ │ │ │ │ ├── MobileCreateAppLogic.java
│ │ │ │ │ │ ├── MobileDeleteAppLogic.java
│ │ │ │ │ │ ├── MobileMailQRsLogic.java
│ │ │ │ │ │ ├── MobileUpdateAppLogic.java
│ │ │ │ │ │ └── MobileUpdateFaceLogic.java
│ │ │ │ │ ├── graph/
│ │ │ │ │ │ ├── MobileDeleteDeviceDataLogic.java
│ │ │ │ │ │ ├── MobileDeleteEnhancedGraphDataLogic.java
│ │ │ │ │ │ ├── MobileExportGraphDataLogic.java
│ │ │ │ │ │ ├── MobileGetEnhancedGraphDataLogic.java
│ │ │ │ │ │ └── links/
│ │ │ │ │ │ └── DeviceFileLink.java
│ │ │ │ │ ├── reporting/
│ │ │ │ │ │ ├── MobileCreateReportLogic.java
│ │ │ │ │ │ ├── MobileDeleteReportLogic.java
│ │ │ │ │ │ ├── MobileExportReportLogic.java
│ │ │ │ │ │ └── MobileUpdateReportLogic.java
│ │ │ │ │ └── sharing/
│ │ │ │ │ ├── MobileGetShareTokenLogic.java
│ │ │ │ │ ├── MobileRefreshShareTokenLogic.java
│ │ │ │ │ └── MobileShareLogic.java
│ │ │ │ └── sharing/
│ │ │ │ ├── MobileShareHandler.java
│ │ │ │ ├── auth/
│ │ │ │ │ ├── MobileShareLoginHandler.java
│ │ │ │ │ └── MobileShareStateHolder.java
│ │ │ │ └── logic/
│ │ │ │ └── MobileShareHardwareLogic.java
│ │ │ └── utils/
│ │ │ └── MobileStateHolderUtil.java
│ │ └── resources/
│ │ └── static/
│ │ ├── register-email.html
│ │ └── report-email.html
│ └── test/
│ └── java/
│ └── cc/
│ └── blynk/
│ ├── server/
│ │ └── application/
│ │ └── handlers/
│ │ ├── GetGraphDataHandlerTest.java
│ │ └── main/
│ │ ├── auth/
│ │ │ ├── RegistrationLimitCheckerTest.java
│ │ │ └── VersionTest.java
│ │ └── logic/
│ │ └── reporting/
│ │ ├── CreateReportTestTimingTest.java
│ │ └── ExportGraphDataLogicTest.java
│ └── utils/
│ └── EMailValidationTest.java
├── tcp-hardware-server/
│ ├── pom.xml
│ └── src/
│ ├── main/
│ │ └── java/
│ │ └── cc/
│ │ └── blynk/
│ │ └── server/
│ │ └── hardware/
│ │ ├── handlers/
│ │ │ └── hardware/
│ │ │ ├── HardwareChannelStateHandler.java
│ │ │ ├── HardwareHandler.java
│ │ │ ├── MqttHardwareHandler.java
│ │ │ ├── auth/
│ │ │ │ └── HardwareLoginHandler.java
│ │ │ ├── logic/
│ │ │ │ ├── BlynkInternalLogic.java
│ │ │ │ ├── BridgeLogic.java
│ │ │ │ ├── HardwareLogic.java
│ │ │ │ ├── HardwareSyncLogic.java
│ │ │ │ ├── MailLogic.java
│ │ │ │ ├── PushLogic.java
│ │ │ │ ├── SetWidgetPropertyLogic.java
│ │ │ │ ├── SmsLogic.java
│ │ │ │ └── TwitLogic.java
│ │ │ └── mqtt/
│ │ │ ├── auth/
│ │ │ │ └── MqttHardwareLoginHandler.java
│ │ │ └── logic/
│ │ │ └── MqttHardwareLogic.java
│ │ └── internal/
│ │ └── BridgeForwardMessage.java
│ └── test/
│ └── java/
│ └── cc/
│ └── blynk/
│ └── server/
│ └── hardware/
│ └── handlers/
│ └── TwitHandlerTest.java
├── tcp-web-server/
│ └── pom.xml
├── tools/
│ ├── pom.xml
│ └── src/
│ ├── main/
│ │ └── java/
│ │ └── cc/
│ │ └── blynk/
│ │ └── server/
│ │ └── tools/
│ │ ├── ForwardingTokenGenerator.java
│ │ └── ReportingDataCleaner.java
│ └── test/
│ └── java/
│ └── cc/
│ └── blynk/
│ └── server/
│ └── tools/
│ └── ReportingDataCleanerTest.java
└── utils/
├── pom.xml
└── src/
├── main/
│ └── java/
│ ├── cc/
│ │ └── blynk/
│ │ └── utils/
│ │ ├── AppNameUtil.java
│ │ ├── ArrayUtil.java
│ │ ├── BlynkTPFactory.java
│ │ ├── ByteUtils.java
│ │ ├── DateTimeUtils.java
│ │ ├── FileLoaderUtil.java
│ │ ├── FileUtils.java
│ │ ├── IPUtils.java
│ │ ├── IntArray.java
│ │ ├── JarUtil.java
│ │ ├── KMPMatch.java
│ │ ├── NumberUtil.java
│ │ ├── ReflectionUtil.java
│ │ ├── ReportingUtil.java
│ │ ├── SHA256Util.java
│ │ ├── StringUtils.java
│ │ ├── TokenGeneratorUtil.java
│ │ ├── http/
│ │ │ ├── ContentType.java
│ │ │ └── MediaType.java
│ │ ├── properties/
│ │ │ ├── BaseProperties.java
│ │ │ ├── DBProperties.java
│ │ │ ├── GCMProperties.java
│ │ │ ├── MailProperties.java
│ │ │ ├── Placeholders.java
│ │ │ ├── ServerProperties.java
│ │ │ ├── SmsProperties.java
│ │ │ └── TwitterProperties.java
│ │ ├── structure/
│ │ │ ├── BaseLimitedQueue.java
│ │ │ ├── LCDLimitedQueue.java
│ │ │ ├── LRUCache.java
│ │ │ ├── LimitedArrayDeque.java
│ │ │ ├── MapLimitedQueue.java
│ │ │ ├── TableLimitedQueue.java
│ │ │ └── TerminalLimitedQueue.java
│ │ └── validators/
│ │ ├── BlynkEmailValidator.java
│ │ ├── DomainValidator.java
│ │ ├── EmailValidator.java
│ │ ├── InetAddressValidator.java
│ │ └── RegexValidator.java
│ └── module-info.java
└── test/
└── java/
└── cc/
└── blynk/
└── utils/
└── structure/
├── IntArrayTest.java
├── LimitedArrayDequeTest.java
└── LimitedQueueTest.java
Showing preview only (366K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (4084 symbols across 654 files)
FILE: client/src/main/java/cc/blynk/client/ClientLauncher.java
class ClientLauncher (line 20) | public final class ClientLauncher {
method ClientLauncher (line 35) | private ClientLauncher() {
method main (line 38) | public static void main(String[] args) throws ParseException {
FILE: client/src/main/java/cc/blynk/client/CommandParserUtil.java
class CommandParserUtil (line 79) | public final class CommandParserUtil {
method CommandParserUtil (line 81) | private CommandParserUtil() {
method parseCommand (line 84) | public static Short parseCommand(String stringCommand) {
FILE: client/src/main/java/cc/blynk/client/core/ActiveHardwareClient.java
class ActiveHardwareClient (line 24) | public class ActiveHardwareClient extends BaseClient {
method ActiveHardwareClient (line 29) | public ActiveHardwareClient(String host, int port) {
method makeCommand (line 36) | private static HardwareMessage makeCommand(String body) {
method getChannelInitializer (line 40) | @Override
method start (line 53) | public void start(String token) {
method send (line 81) | public void send(String line) {
FILE: client/src/main/java/cc/blynk/client/core/AppClient.java
class AppClient (line 24) | public class AppClient extends BaseClient {
method AppClient (line 28) | public AppClient(String host, int port) {
method AppClient (line 32) | protected AppClient(String host, int port, Random msgIdGenerator, Serv...
method getChannelInitializer (line 60) | @Override
FILE: client/src/main/java/cc/blynk/client/core/BaseClient.java
class BaseClient (line 44) | public abstract class BaseClient {
method BaseClient (line 55) | public BaseClient(String host, int port, Random messageIdGenerator) {
method BaseClient (line 59) | public BaseClient(String host, int port, Random messageIdGenerator, Se...
method BaseClient (line 67) | public BaseClient(String host, int port, Random messageIdGenerator, Ni...
method produceMessageBaseOnUserInput (line 75) | public static MessageBase produceMessageBaseOnUserInput(String line, i...
method start (line 106) | public void start(BufferedReader commandInputStream) {
method start (line 133) | public void start() {
method makeCertificateFile (line 145) | protected File makeCertificateFile(String propertyName) {
method getChannelInitializer (line 157) | protected abstract ChannelInitializer<SocketChannel> getChannelInitial...
method readUserInput (line 159) | private void readUserInput(BufferedReader commandInputStream) throws I...
method send (line 178) | public void send(Object msg) {
method isClosed (line 182) | public boolean isClosed() {
method stop (line 186) | public ChannelFuture stop() {
FILE: client/src/main/java/cc/blynk/client/core/HardwareClient.java
class HardwareClient (line 21) | public class HardwareClient extends BaseClient {
method HardwareClient (line 23) | public HardwareClient(String host, int port) {
method getChannelInitializer (line 30) | @Override
FILE: client/src/main/java/cc/blynk/client/enums/ClientMode.java
type ClientMode (line 8) | public enum ClientMode {
method parse (line 12) | public static ClientMode parse(String val) {
FILE: client/src/main/java/cc/blynk/client/handlers/ClientReplayingMessageDecoder.java
class ClientReplayingMessageDecoder (line 13) | public class ClientReplayingMessageDecoder extends ClientMessageDecoder {
method channelInactive (line 15) | @Override
method exceptionCaught (line 20) | @Override
FILE: client/src/main/java/cc/blynk/client/handlers/decoders/AppClientMessageDecoder.java
class AppClientMessageDecoder (line 31) | public class AppClientMessageDecoder extends ByteToMessageDecoder {
method decode (line 35) | @Override
method exceptionCaught (line 79) | @Override
FILE: client/src/main/java/cc/blynk/client/handlers/decoders/ClientMessageDecoder.java
class ClientMessageDecoder (line 30) | public class ClientMessageDecoder extends ByteToMessageDecoder {
method decode (line 34) | @Override
method exceptionCaught (line 78) | @Override
FILE: client/src/main/java/cc/blynk/client/handlers/hardware/HardwareEchoHandler.java
class HardwareEchoHandler (line 19) | @ChannelHandler.Sharable
method channelRead0 (line 22) | @Override
method read (line 47) | private void read(ChannelHandlerContext ctx, PinType pinType, short pi...
FILE: client/src/test/java/cc/blynk/client/ClientTest.java
class ClientTest (line 23) | @RunWith(MockitoJUnitRunner.class)
method testQuitApp (line 29) | @Test
method testQuitHard (line 38) | @Test
FILE: docs/websocket/Command.js
function getCommandByString (line 22) | function getCommandByString(cmdString) {
function getStringByCommandCode (line 33) | function getStringByCommandCode(cmd) {
function getStatusByCode (line 42) | function getStatusByCode(statusCode) {
FILE: integration-tests/src/test/java/cc/blynk/integration/BaseTest.java
class BaseTest (line 27) | public abstract class BaseTest extends CounterBase {
method initHolderAndDataFolder (line 36) | @Before
method initProps (line 42) | @BeforeClass
method closeTransport (line 48) | @After
method getRelativeDataFolder (line 53) | public static String getRelativeDataFolder(String path) {
method initAppAndHardPair (line 66) | public static ClientPair initAppAndHardPair() throws Exception {
method decompress (line 71) | public static byte[] decompress(byte[] bytes) {
method initAppAndHardPair (line 85) | public static ClientPair initAppAndHardPair(String jsonProfile) throws...
method initAppAndHardPair (line 89) | public static ClientPair initAppAndHardPair(int tcpAppPort, int tcpHar...
method initAppAndHardPair (line 93) | public static ClientPair initAppAndHardPair(ServerProperties propertie...
FILE: integration-tests/src/test/java/cc/blynk/integration/CounterBase.java
class CounterBase (line 9) | public abstract class CounterBase {
method getUserName (line 20) | public static String getUserName() {
method incrementAndGetUserName (line 24) | protected static String incrementAndGetUserName() {
method incrementCounter (line 28) | @Before
method getDataFolder (line 33) | public String getDataFolder() {
FILE: integration-tests/src/test/java/cc/blynk/integration/MyHostVerifier.java
class MyHostVerifier (line 6) | public class MyHostVerifier implements HostnameVerifier {
method verify (line 8) | @Override
FILE: integration-tests/src/test/java/cc/blynk/integration/SingleServerInstancePerTest.java
class SingleServerInstancePerTest (line 22) | public abstract class SingleServerInstancePerTest extends CounterBase {
method init (line 30) | @BeforeClass
method shutdown (line 39) | @AfterClass
method closeClients (line 46) | @After
method resetBeforeTest (line 51) | @Before
method initAppAndHardPair (line 60) | public ClientPair initAppAndHardPair() throws Exception {
method changeProfileTo (line 66) | protected String changeProfileTo() {
method initClientPair (line 70) | protected ClientPair initClientPair() throws Exception {
FILE: integration-tests/src/test/java/cc/blynk/integration/SingleServerInstancePerTestWithDB.java
class SingleServerInstancePerTestWithDB (line 23) | public abstract class SingleServerInstancePerTestWithDB extends CounterB...
method init (line 31) | @BeforeClass
method shutdown (line 41) | @AfterClass
method closeClients (line 48) | @After
method resetBeforeTest (line 53) | @Before
method initAppAndHardPair (line 62) | public ClientPair initAppAndHardPair() throws Exception {
method changeProfileTo (line 68) | protected String changeProfileTo() {
method initClientPair (line 72) | protected ClientPair initClientPair() throws Exception {
FILE: integration-tests/src/test/java/cc/blynk/integration/TestUtil.java
class TestUtil (line 74) | public final class TestUtil {
method TestUtil (line 78) | private TestUtil() {
method getBody (line 81) | public static String getBody(SimpleClientHandler responseMock) throws ...
method getBody (line 85) | public static String getBody(SimpleClientHandler responseMock, int exp...
method parseProfile (line 102) | public static Profile parseProfile(InputStream reader) throws Exception {
method parseProfile (line 106) | public static Profile parseProfile(String reader) throws Exception {
method readTestUserProfile (line 111) | public static String readTestUserProfile(String fileName) throws Excep...
method readTestUserProfile (line 117) | public static String readTestUserProfile() throws Exception {
method saveProfile (line 121) | public static void saveProfile(TestAppClient appClient, DashBoard... d...
method b (line 127) | public static String b(String body) {
method illegalCommand (line 131) | public static ResponseMessage illegalCommand(int msgId) {
method illegalCommandBody (line 135) | public static ResponseMessage illegalCommandBody(int msgId) {
method ok (line 139) | public static ResponseMessage ok(int msgId) {
method bridge (line 143) | public static StringMessage bridge(int msgId, String body) {
method internal (line 147) | public static StringMessage internal(int msgId, String body) {
method hardwareConnected (line 151) | public static StringMessage hardwareConnected(int msgId, String body) {
method getServer (line 155) | public static GetServerMessage getServer(int msgId, String body) {
method deviceOffline (line 159) | public static StringMessage deviceOffline(int msgId, String body) {
method createTag (line 163) | public static StringMessage createTag(int msgId, Tag tag) {
method createTag (line 167) | public static StringMessage createTag(int msgId, String body) {
method appIsOutdated (line 171) | public static StringMessage appIsOutdated(int msgId, String body) {
method appSync (line 175) | public static StringMessage appSync(int msgId, String body) {
method hardware (line 179) | public static StringMessage hardware(int msgId, String body) {
method appSync (line 183) | public static StringMessage appSync(String body) {
method setProperty (line 187) | public static StringMessage setProperty(int msgId, String body) {
method createDevice (line 191) | public static StringMessage createDevice(int msgId, String body) {
method createDevice (line 195) | public static StringMessage createDevice(int msgId, Device device) {
method connectRedirect (line 199) | public static StringMessage connectRedirect(int msgId, String body) {
method serverError (line 203) | public static ResponseMessage serverError(int msgId) {
method notAllowed (line 207) | public static ResponseMessage notAllowed(int msgId) {
method invalidToken (line 211) | public static ResponseMessage invalidToken(int msgId) {
method initAppAndHardPair (line 215) | public static ClientPair initAppAndHardPair(String host, int appPort, ...
method initAppAndHardPair (line 226) | public static ClientPair initAppAndHardPair(TestAppClient appClient, T...
method getDataFolder (line 290) | public static String getDataFolder() {
method sleep (line 298) | public static void sleep(int ms) {
method consumeJsonPinValues (line 306) | @SuppressWarnings("unchecked")
method consumeJsonPinValues (line 311) | @SuppressWarnings("unchecked")
method consumeText (line 316) | @SuppressWarnings("unchecked")
method initUnsecuredSSLContext (line 321) | public static SSLContext initUnsecuredSSLContext() throws NoSuchAlgori...
method createHolderWithIOMock (line 345) | public static Holder createHolderWithIOMock(ServerProperties serverPro...
method createDefaultHolder (line 356) | public static Holder createDefaultHolder(ServerProperties serverProper...
FILE: integration-tests/src/test/java/cc/blynk/integration/http/AcmeTest.java
class AcmeTest (line 34) | @RunWith(MockitoJUnitRunner.class)
method shutdown (line 40) | @After
method init (line 45) | @Before
method getDataFolder (line 52) | @Override
method testCorrectContext (line 57) | @Test
method testCreateCertificates (line 66) | @Test
method testWorker (line 77) | @Test
FILE: integration-tests/src/test/java/cc/blynk/integration/http/HttpAPIKeepAliveServerTest.java
class HttpAPIKeepAliveServerTest (line 32) | @RunWith(MockitoJUnitRunner.class)
method shutdown (line 39) | @After
method init (line 45) | @Before
method getDataFolder (line 56) | @Override
method testKeepAlive (line 61) | @Test
method keepAliveIsSupported (line 88) | @Test(expected = Exception.class)
method testHttpAPICounters (line 114) | @Test
FILE: integration-tests/src/test/java/cc/blynk/integration/http/HttpAPIPinsAsyncClientTest.java
class HttpAPIPinsAsyncClientTest (line 51) | @RunWith(MockitoJUnitRunner.class)
method closeHttp (line 57) | @AfterClass
method init (line 62) | @BeforeClass
method testGetWithFakeToken (line 80) | @Test
method testGetWithWrongPathToken (line 89) | @Test
method testGetWithWrongPin (line 95) | @Test
method testGetWithNonExistingPin (line 104) | @Test
method testPutViaGetRequestSingleValue (line 113) | @Test
method testPutAndGetTerminalValue (line 131) | @Test
method testPutViaGetRequestMultipleValue (line 160) | @Test
method testPutGetNonExistingPin (line 179) | @Test
method testMultiPutGetNonExistingPin (line 200) | @Test
method testGetPinData (line 223) | @Test
method testGetCSVDataRedirect (line 243) | @Test
method testChangeLabelPropertyViaGet (line 265) | @Test
method testChangeColorPropertyViaGet (line 283) | @Test
method testChangeOnLabelPropertyViaGet (line 301) | @Test
method testChangeOffLabelPropertyViaGet (line 323) | @Test
FILE: integration-tests/src/test/java/cc/blynk/integration/http/HttpAPIPinsTest.java
class HttpAPIPinsTest (line 38) | @RunWith(MockitoJUnitRunner.class)
method init (line 44) | @BeforeClass
method closeHttp (line 56) | @AfterClass
method testGetWithFakeToken (line 63) | @Test
method testGetWithWrongPathToken (line 73) | @Test
method testGetWithWrongPin (line 82) | @Test
method testGetWithNonExistingPin (line 92) | @Test
method testGetWringPin (line 102) | @Test
method testPutGetNonExistingPin (line 112) | @Test
method testMultiPutGetNonExistingPin (line 131) | @Test
method testMultiPutGetNonExistingPinWithNewMethod (line 152) | @Test
method testGetTimerExistingPin (line 173) | @Test
method testGetWithExistingPin (line 185) | @Test
method testGetWithExistingEmptyPin (line 214) | @Test
method testGetWithExistingMultiPin (line 225) | @Test
method testGetForRGBMerge (line 238) | @Test
method testGetForJoystickMerge (line 252) | @Test
method testPutNoContentType (line 267) | @Test
method testPutFakeToken (line 277) | @Test
method testPutWithWrongPin (line 289) | @Test
method testPutWithNoWidget (line 301) | @Test
method testPutWithNoWidgetNoPinData (line 312) | @Test
method testPutWithNoWidgetMultivalue (line 324) | @Test
method testPutWithLargeValueNotAccepted (line 335) | @Test
method testPutExtraWithNoWidget (line 353) | @Test
method testPutWithExistingPin (line 364) | @Test
method testPutWithExistingPinWrongBody (line 383) | @Test
method testPutWithExistingPinWrongBody2 (line 394) | @Test
method testPostNotifyNoContentType (line 408) | @Test
method testPostNotifyNoBody (line 418) | @Test
method testPostNotifyWithWrongBody (line 429) | @Test
method testPostNotifyWithBody (line 444) | @Test
method testPostEmailNoContentType (line 457) | @Test
method testPostEmailNoBody (line 467) | @Test
method testPostEmailWithBody (line 478) | @Test
method testSync (line 490) | @Test
FILE: integration-tests/src/test/java/cc/blynk/integration/http/HttpAndTCPSameJVMTest.java
class HttpAndTCPSameJVMTest (line 87) | @RunWith(MockitoJUnitRunner.class)
method closeHttp (line 93) | @AfterClass
method init (line 98) | @BeforeClass
method testChangeNonWidgetPinValueViaHardwareAndGetViaHTTP (line 111) | @Test
method testChangePinValueViaAppAndHardware (line 138) | @Test
method testRTCWorksViaHttpAPI (line 165) | @Test
method testEventorWorksViaHttpAPI (line 186) | @Test
method testEventorTimerWidgeWorkerWorksAsExpectedWithHttp (line 209) | @Test
method testTimerWidgeWorkerWorksAsExpectedWithHttp (line 248) | @Test
method testChangePinValueViaAppAndHardwareForWrongPWMButton (line 290) | @Test
method testChangePinValueViaHttpAPI (line 316) | @Test
method testQRWorks (line 339) | @Test
method testIsHardwareAndAppConnected (line 371) | @Test
method testIsHardwareAndAppDisconnected (line 392) | @Test
method testIsHardwareConnecteedWithMultiDevices (line 415) | @Test
method testChangePinValueViaHttpAPIAndNoActiveProject (line 487) | @Test
method testChangeLCDPinValueViaHttpAPIAndValueChanged (line 506) | @Test
method testChangePinValueViaHttpAPIAndNoWidgetSinglePinValue (line 529) | @Test
method testChangePinValueViaHttpAPIAndForTerminal (line 542) | @Test
method testChangePinValueViaHttpAPIAndNoWidgetMultiPinValue (line 558) | @Test
method tableSetValueViaHttpApi (line 570) | @Test
method sendMultiValueToAppViaHttpApi (line 589) | @Test
method sendMultiValueToAppViaHttpApi2 (line 600) | @Test
method sendMultiValueToAppViaHttpApi3 (line 622) | @Test
method superchartPinsOverlapsWithOtherWidgets (line 646) | @Test
method webhookPinsOverlapsWithOtherWidgets (line 698) | @Test
FILE: integration-tests/src/test/java/cc/blynk/integration/http/OTATest.java
class OTATest (line 64) | @RunWith(MockitoJUnitRunner.class)
method shutdown (line 76) | @After
method init (line 84) | @Before
method testInitiateOTA (line 109) | @Test
method testInitiateOTAWithFileName (line 122) | @Test
method testImprovedUploadMethod (line 144) | @Test
method testOTAFailedWhenNoDevice (line 182) | @Test
method testOTAWrongToken (line 210) | @Test
method testAuthorizationFailed (line 236) | @Test
method testImprovedUploadMethodAndCheckOTAStatusForDeviceThatNeverWasOnline (line 262) | @Test
method testImprovedUploadMethodAndCheckOTAStatusForDeviceThatWasOnline (line 307) | @Test
method takeBuildDateFromBinaryFile (line 368) | @Test
method basicOTAForAllDevices (line 376) | @Test
method testConnectedDeviceGotOTACommand (line 414) | @Test
method testStopOTA (line 462) | @Test
method basicOTAForNonExistingSingleUser (line 502) | @Test
method basicOTAForSingleUser (line 527) | @Test
method basicOTAForSingleUserAndNonExistingProject (line 568) | @Test
method basicOTAForSingleUserAndExistingProject (line 609) | @Test
FILE: integration-tests/src/test/java/cc/blynk/integration/http/UploadAPITest.java
class UploadAPITest (line 38) | @RunWith(MockitoJUnitRunner.class)
method init (line 45) | @Before
method shutdown (line 51) | @After
method uploadFileToServer (line 57) | @Test
method upload (line 69) | private String upload(String filename) throws Exception {
FILE: integration-tests/src/test/java/cc/blynk/integration/https/HttpResetPassTest.java
class HttpResetPassTest (line 37) | @RunWith(MockitoJUnitRunner.class)
method shutdown (line 44) | @After
method init (line 50) | @Before
method getDataFolder (line 60) | @Override
method submitResetPasswordRequest (line 65) | @Test
method correctToken (line 95) | @Test
method getRestorePageXss (line 107) | @Test
method getRestorePageXss2 (line 119) | @Test
method getRestorePageXss3 (line 132) | @Test
FILE: integration-tests/src/test/java/cc/blynk/integration/https/HttpsAdminServerTest.java
class HttpsAdminServerTest (line 62) | @RunWith(MockitoJUnitRunner.class)
method shutdown (line 74) | @After
method init (line 81) | @Before
method getDataFolder (line 107) | @Override
method testGetOnExistingUser (line 112) | @Test
method testGetWrongUrl (line 123) | @Test
method adminLoginFlowSupport (line 134) | @Test
method adminLoginOnlyForSuperUser (line 154) | @Test
method testGetUserFromAdminPageNoAccess (line 178) | @Test
method testGetUserFromAdminPageNoAccessWithFakeCookie (line 189) | @Test
method testGetUserFromAdminPageNoAccessWithFakeCookie2 (line 201) | @Test
method testGetUserFromAdminPage (line 224) | @Test
method login (line 243) | private void login(String name, String pass) throws Exception {
method testChangeUsernameChangesPassToo (line 261) | @Test
method testUpdateUser (line 307) | @Test
method testGetAdminPage (line 371) | @Test
method testGetFavIconHttps (line 380) | @Test
method getStaticFile (line 389) | @Test
method getStaticFilePathOperationVulnerability (line 398) | @Test
method getStaticFilePathOperationVulnerability2 (line 407) | @Test
method getStaticFilePathOperationVulnerability3 (line 416) | @Test
method testGetFavIconHttp (line 425) | @Test
method testAssignNewTokenForNonExistingToken (line 434) | @Test
method testAssignNewToken (line 444) | @Test
method testForceAssignNewToken (line 477) | @Test
FILE: integration-tests/src/test/java/cc/blynk/integration/model/MockHolder.java
class MockHolder (line 17) | public class MockHolder {
method MockHolder (line 21) | public MockHolder(SimpleClientHandler mock) {
method check (line 25) | public MockHolder check(int responseMessageCode) throws Exception {
method check (line 30) | public MockHolder check(int times, int responseMessageCode) throws Exc...
method check (line 35) | public void check(MessageBase responseMessage) throws Exception {
FILE: integration-tests/src/test/java/cc/blynk/integration/model/SimpleClientHandler.java
class SimpleClientHandler (line 12) | public class SimpleClientHandler extends SimpleChannelInboundHandler<Mes...
method channelRead0 (line 14) | @Override
FILE: integration-tests/src/test/java/cc/blynk/integration/model/http/PinJsonResponse.java
class PinJsonResponse (line 8) | public class PinJsonResponse {
FILE: integration-tests/src/test/java/cc/blynk/integration/model/http/ResponseUserEntity.java
class ResponseUserEntity (line 8) | public class ResponseUserEntity {
method ResponseUserEntity (line 12) | public ResponseUserEntity(String pass) {
method toString (line 16) | @Override
FILE: integration-tests/src/test/java/cc/blynk/integration/model/tcp/BaseTestAppClient.java
class BaseTestAppClient (line 22) | public abstract class BaseTestAppClient extends AppClient {
method BaseTestAppClient (line 27) | public BaseTestAppClient(String host, int port, Random msgIdGenerator,...
method verifyResult (line 31) | public void verifyResult(Object exceptedResult) throws Exception {
method never (line 35) | public void never(Object exceptedResult) throws Exception {
method neverAfter (line 39) | public void neverAfter(int time, Object exceptedResult) throws Excepti...
method verifyResult (line 43) | public void verifyResult(Object exceptedResult, int times) throws Exce...
method verifyResultAfter (line 47) | public void verifyResultAfter(int time, Object exceptedResult) throws ...
method verifyAny (line 51) | public void verifyAny() throws Exception {
method getBody (line 55) | public String getBody() throws Exception {
method getBody (line 59) | public String getBody(int expectedMessageOrder) throws Exception {
method reset (line 63) | public void reset() {
method send (line 68) | public void send(String line) {
FILE: integration-tests/src/test/java/cc/blynk/integration/model/tcp/BaseTestHardwareClient.java
class BaseTestHardwareClient (line 20) | public abstract class BaseTestHardwareClient extends BaseClient {
method BaseTestHardwareClient (line 25) | public BaseTestHardwareClient(String host, int port, Random messageIdG...
method never (line 29) | public void never(Object exceptedResult) throws Exception {
method verifyResult (line 33) | public void verifyResult(Object exceptedResult, int times) throws Exce...
method verifyResult (line 37) | public void verifyResult(Object exceptedResult) throws Exception {
method getBody (line 41) | public String getBody() throws Exception {
method getBody (line 45) | public String getBody(int expectedMessageOrder) throws Exception {
method reset (line 49) | public void reset() {
method send (line 54) | public void send(String line) {
FILE: integration-tests/src/test/java/cc/blynk/integration/model/tcp/ClientPair.java
class ClientPair (line 8) | public class ClientPair {
method ClientPair (line 16) | public ClientPair(TestAppClient appClient, TestHardClient hardwareClie...
method stop (line 22) | public void stop() {
FILE: integration-tests/src/test/java/cc/blynk/integration/model/tcp/TestAppClient.java
class TestAppClient (line 43) | public class TestAppClient extends BaseTestAppClient {
method TestAppClient (line 45) | public TestAppClient(String host, int port) {
method TestAppClient (line 49) | public TestAppClient(ServerProperties properties) {
method TestAppClient (line 53) | public TestAppClient(String host, ServerProperties properties) {
method TestAppClient (line 57) | public TestAppClient(String host, int port, ServerProperties propertie...
method TestAppClient (line 61) | public TestAppClient(String host, int port, ServerProperties propertie...
method parseDevice (line 66) | public Device parseDevice() throws Exception {
method parseProfile (line 70) | public Profile parseProfile(int expectedMessageOrder) throws Exception {
method parseDevice (line 74) | public Device parseDevice(int expectedMessageOrder) throws Exception {
method parseDevices (line 78) | public Device[] parseDevices() throws Exception {
method parseDevices (line 82) | public Device[] parseDevices(int expectedMessageOrder) throws Exception {
method parseTags (line 86) | public Tag[] parseTags(int expectedMessageOrder) throws Exception {
method parseApp (line 90) | public App parseApp(int expectedMessageOrder) throws Exception {
method parseDash (line 94) | public DashBoard parseDash(int expectedMessageOrder) throws Exception {
method parseReportFromResponse (line 98) | public Report parseReportFromResponse(int expectedMessageOrder) throws...
method getBinaryBody (line 102) | public BinaryMessage getBinaryBody() throws Exception {
method getChannelInitializer (line 108) | @Override
method createTag (line 123) | public void createTag(int dashId, Tag tag) {
method updateTag (line 127) | public void updateTag(int dashId, Tag tag) {
method createDevice (line 131) | public void createDevice(int dashId, Device device) {
method updateDevice (line 135) | public void updateDevice(int dashId, Device device) {
method deleteDevice (line 139) | public void deleteDevice(int dashId, int deviceId) {
method createWidget (line 143) | public void createWidget(int dashId, Widget widget) throws Exception {
method createWidget (line 147) | public void createWidget(int dashId, long widgetId, long templateId, S...
method createWidget (line 152) | public void createWidget(int dashId, long widgetId, long templateId, W...
method createWidget (line 157) | public void createWidget(int dashId, String widgetJson) {
method updateWidget (line 161) | public void updateWidget(int dashId, Widget widget) throws Exception {
method updateWidget (line 165) | public void updateWidget(int dashId, String widgetJson) {
method deleteWidget (line 169) | public void deleteWidget(int dashId, long widgetId) {
method activate (line 173) | public void activate(int dashId) {
method deactivate (line 177) | public void deactivate(int dashId) {
method updateDash (line 181) | public void updateDash(DashBoard dashBoard) {
method updateDash (line 185) | public void updateDash(String dashJson) {
method deleteDash (line 189) | public void deleteDash(int dashId) {
method deleteTag (line 193) | public void deleteTag(int dashId, int tagId) {
method createDash (line 197) | public void createDash(DashBoard dashBoard) {
method createDash (line 201) | public void createDash(String dashJson) {
method register (line 205) | public void register(String email, String pass, String appName) {
method login (line 209) | public void login(String email, String pass) {
method login (line 213) | public void login(String email, String pass, String os, String version) {
method login (line 217) | public void login(String email, String pass, String os, String version...
method sync (line 222) | public void sync(int dashId) {
method sync (line 226) | public void sync(int dashId, int deviceId) {
method deleteDeviceData (line 230) | public void deleteDeviceData(int dashId, int deviceId) {
method deleteDeviceData (line 234) | public void deleteDeviceData(int dashId, int deviceId, String... pins) {
method getEnhancedGraphData (line 242) | public void getEnhancedGraphData(int dashId, long widgetId, GraphPerio...
method getEnhancedGraphData (line 246) | public void getEnhancedGraphData(int dashId, long widgetId, GraphPerio...
method createTemplate (line 250) | public void createTemplate(int dashId, long widgetId, TileTemplate til...
method createTemplate (line 254) | public void createTemplate(int dashId, long widgetId, String tileTempl...
method updateTemplate (line 258) | public void updateTemplate(int dashId, long widgetId, TileTemplate til...
method createReport (line 263) | public void createReport(int dashId, Report report) {
method createReport (line 267) | public void createReport(int dashId, String report) {
method updateReport (line 271) | public void updateReport(int dashId, Report report) {
method getWidget (line 275) | public void getWidget(int dashId, long widgetId) {
method parseWidget (line 279) | public Widget parseWidget(int expectedMessageOrder) throws Exception {
method deleteReport (line 283) | public void deleteReport(int dashId, int reportId) {
method exportReport (line 287) | public void exportReport(int dashId, int reportId) {
method getDevice (line 291) | public void getDevice(int dashId, int deviceId) {
method send (line 295) | public void send(String line) {
method send (line 299) | public void send(String line, int id) {
method getProvisionToken (line 303) | public void getProvisionToken(int dashId, Device device) {
method createApp (line 307) | public void createApp(App app) {
method loadProfileGzipped (line 311) | public void loadProfileGzipped() {
method replace (line 315) | public void replace(SimpleClientHandler simpleClientHandler) {
FILE: integration-tests/src/test/java/cc/blynk/integration/model/tcp/TestHardClient.java
class TestHardClient (line 23) | public class TestHardClient extends BaseTestHardwareClient {
method TestHardClient (line 25) | public TestHardClient(String host, int port) {
method TestHardClient (line 29) | public TestHardClient(String host, int port, NioEventLoopGroup nioEven...
method getChannelInitializer (line 34) | @Override
method login (line 48) | public void login(String token) {
method setProperty (line 52) | public void setProperty(int pin, String property, String value) {
method setProperty (line 56) | public void setProperty(int pin, String property, String... value) {
method sync (line 60) | public void sync() {
method sync (line 64) | public void sync(PinType pinType, int pin) {
method sync (line 68) | public void sync(PinType pinType, int pin1, int pin2) {
method replace (line 72) | public void replace(SimpleClientHandler simpleClientHandler) {
FILE: integration-tests/src/test/java/cc/blynk/integration/model/tcp/TestSslHardClient.java
class TestSslHardClient (line 28) | public class TestSslHardClient extends BaseTestHardwareClient {
method TestSslHardClient (line 32) | public TestSslHardClient(String host, int port) {
method TestSslHardClient (line 36) | private TestSslHardClient(String host, int port, NioEventLoopGroup nio...
method getChannelInitializer (line 65) | @Override
method login (line 80) | public void login(String token) {
method setProperty (line 84) | public void setProperty(int pin, String property, String value) {
method sync (line 88) | public void sync() {
method sync (line 92) | public void sync(PinType pinType, int pin) {
method sync (line 96) | public void sync(PinType pinType, int pin1, int pin2) {
method replace (line 100) | public void replace(SimpleClientHandler simpleClientHandler) {
FILE: integration-tests/src/test/java/cc/blynk/integration/model/websocket/AppWebSocketClient.java
class AppWebSocketClient (line 47) | public final class AppWebSocketClient extends BaseTestAppClient {
method AppWebSocketClient (line 53) | public AppWebSocketClient(String host, int port, String path) throws E...
method produceWebSocketFrame (line 66) | private static WebSocketFrame produceWebSocketFrame(MessageBase msg) {
method getChannelInitializer (line 75) | @Override
method start (line 94) | @Override
method startHandshake (line 100) | private void startHandshake() {
method login (line 110) | public void login(String email, String pass) {
method send (line 114) | public void send(String line) {
FILE: integration-tests/src/test/java/cc/blynk/integration/model/websocket/AppWebSocketClientHandler.java
class AppWebSocketClientHandler (line 55) | public class AppWebSocketClientHandler extends SimpleChannelInboundHandl...
method AppWebSocketClientHandler (line 62) | public AppWebSocketClientHandler(WebSocketClientHandshaker handshaker) {
method handshakeFuture (line 66) | public ChannelFuture handshakeFuture() {
method startHandshake (line 70) | public void startHandshake(Channel channel) {
method channelInactive (line 75) | @Override
method channelRead0 (line 80) | @Override
method exceptionCaught (line 109) | @Override
FILE: integration-tests/src/test/java/cc/blynk/integration/model/websocket/WebSocketClient.java
class WebSocketClient (line 47) | public final class WebSocketClient extends BaseClient {
method WebSocketClient (line 54) | public WebSocketClient(String host, int port, String path, boolean isS...
method produceWebSocketFrame (line 71) | private static WebSocketFrame produceWebSocketFrame(MessageBase msg) {
method getChannelInitializer (line 81) | @Override
method start (line 101) | @Override
method startHandshake (line 107) | private void startHandshake() {
method send (line 117) | public void send(String line) {
FILE: integration-tests/src/test/java/cc/blynk/integration/model/websocket/WebSocketClientHandler.java
class WebSocketClientHandler (line 55) | public class WebSocketClientHandler extends SimpleChannelInboundHandler<...
method WebSocketClientHandler (line 62) | public WebSocketClientHandler(WebSocketClientHandshaker handshaker) {
method handshakeFuture (line 66) | public ChannelFuture handshakeFuture() {
method startHandshake (line 70) | public void startHandshake(Channel channel) {
method channelInactive (line 75) | @Override
method channelRead0 (line 80) | @Override
method exceptionCaught (line 110) | @Override
FILE: integration-tests/src/test/java/cc/blynk/integration/tcp/AppMailTest.java
class AppMailTest (line 31) | @RunWith(MockitoJUnitRunner.class)
method testSendEmail (line 34) | @Test
method testSendEmailForDevice (line 45) | @Test
method testSendEmailForSingleDevice (line 56) | @Test
method testSendEmailForMultiDevices (line 88) | @Test
method testEmailMininalValidation (line 128) | @Test
method testEmailWorks (line 139) | @Test
method testPlainTextIsAllowed (line 157) | @Test
method testPlaceholderForDeviceNameWorks (line 168) | @Test
method testPlaceholderForVendorWorks (line 179) | @Test
method testPlaceholderForDeviceOwnerWorks (line 190) | @Test
method testEmailWorkWithEmailFromApp (line 201) | @Test
method testEmailFromAppOverridesEmailFromHardware (line 212) | @Test
method testEmailWorkWithNoEmailInApp (line 223) | @Test
FILE: integration-tests/src/test/java/cc/blynk/integration/tcp/AppOfflineTest.java
class AppOfflineTest (line 26) | @RunWith(MockitoJUnitRunner.class)
method init (line 33) | @Before
method shutdown (line 43) | @After
method testWarn (line 50) | @Test
FILE: integration-tests/src/test/java/cc/blynk/integration/tcp/AppSyncWorkflowTest.java
class AppSyncWorkflowTest (line 44) | @RunWith(MockitoJUnitRunner.class)
method testLCDOnActivateSendsCorrectBodySimpleMode (line 47) | @Test
method testLCDOnActivateSendsCorrectBodyAdvancedMode (line 80) | @Test
method testTerminalSendsSyncOnActivate (line 116) | @Test
method testTerminalStorageRemembersCommands (line 143) | @Test
method testTerminalStorageRemembersCommandsInNewFormat (line 166) | @Test
method testTableStorageRemembersCommandsInNewFormat (line 204) | @Test
method testTerminalAndAnotherWidgetOnTheSamePin (line 245) | @Test
method testTerminalAndAnotherWidgetOnTheSamePinAndDeviceSelector (line 286) | @Test
method testTerminalAndAnotherWidgetOnTheSamePinAndDeviceSelectorAnotherOrder (line 345) | @Test
method testTerminalStorageRemembersCommandsInOldFormatAndDeviceSelector (line 404) | @Test
method testTerminalStorageRemembersCommandsInNewFormatAndDeviceTiles (line 460) | @Test
method testTerminalStorageCleanedAfterTilesAreRemoved (line 524) | @Test
method testTerminalStorageRemembersCommandsInNewFormatAndDeviceSelector (line 609) | @Test
method testTableSyncWorkForNewCommandFormat (line 665) | @Test
method testLCDSendsSyncOnActivate (line 710) | @Test
method testLCDSendsSyncOnActivate2 (line 725) | @Test
method testActivateAndGetSync (line 754) | @Test
method testSyncWidgetValueOverlapsWithPinStorage (line 774) | @Test
method testActivateAndGetSyncForSpecificDeviceId (line 827) | @Test
method testSyncForDeviceSelectorAndSetProperty (line 847) | @Test
method testSyncForDeviceTilesAndSetProperty (line 892) | @Test
method testSyncForDeviceSelectorAndSetPropertyAndMultiValueWidget (line 961) | @Test
method testActivateAndGetSyncForTimeInput (line 1006) | @Test
method testActivateAndGetSyncForNonExistingDeviceId (line 1036) | @Test
method testLCDOnActivateSendsCorrectBodySimpleModeAndAnotherDevice (line 1045) | @Test
FILE: integration-tests/src/test/java/cc/blynk/integration/tcp/AppWorkflowTest.java
class AppWorkflowTest (line 29) | @RunWith(MockitoJUnitRunner.class)
method deleteFolder (line 32) | @Before
method testPrintApp (line 37) | @Test
method testAppCreated (line 43) | @Test
method testAppCreated2 (line 59) | @Test
method testUnicodeName (line 72) | @Test
method testCantCreateWithSameId (line 81) | @Test
method testAppUpdated (line 94) | @Test
method testAppDelete (line 120) | @Test
FILE: integration-tests/src/test/java/cc/blynk/integration/tcp/AssignTokenTest.java
class AssignTokenTest (line 29) | @RunWith(MockitoJUnitRunner.class)
method cleanTable (line 32) | @Before
method testNoTokenExists (line 37) | @Test
method testTokenActivate (line 43) | @Test
method testCorrectToken (line 58) | @Test
method testConnectTo443PortForHardware (line 85) | @Test
FILE: integration-tests/src/test/java/cc/blynk/integration/tcp/BlynkInternalTest.java
class BlynkInternalTest (line 26) | @RunWith(MockitoJUnitRunner.class)
method testGetRTC (line 29) | @Test
method testHardwareLoginWithInfo (line 45) | @Test
method appConnectedEvent (line 70) | @Test
method appDisconnectedEvent (line 84) | @Test
method testBuffInIsHandled (line 94) | @Test
FILE: integration-tests/src/test/java/cc/blynk/integration/tcp/BridgeWorkflowTest.java
class BridgeWorkflowTest (line 36) | @RunWith(MockitoJUnitRunner.class)
method initPort (line 41) | @BeforeClass
method changeProfileTo (line 46) | @Override
method testBridgeInitOk (line 51) | @Test
method testBridgeInitIllegalCommand (line 57) | @Test
method testSeveralBridgeInitOk (line 75) | @Test
method testBridgeInitAndOk (line 96) | @Test
method testBridgeWithoutInit (line 102) | @Test
method testBridgeInitAndSendNoOtherDevices (line 108) | @Test
method testBridgeInitAndSendOtherDevicesButNoBridgeDevices (line 117) | @Test
method testSecondTokenNotInitialized (line 143) | @Test
method testCorrectWorkflow2HardsSameToken (line 151) | @Test
method testWrongPinForBridge (line 167) | @Test
method testCorrectWorkflow2HardsDifferentToken (line 182) | @Test
method testCorrectWorkflow3HardsDifferentToken (line 207) | @Test
method testCorrectWorkflow4HardsDifferentToken (line 239) | @Test
method testCorrectWorkflow3HardsDifferentTokenAndSync (line 283) | @Test
method testCorrectWorkflow4HardsDifferentTokenAndSync (line 320) | @Test
method bridgeOnlyWorksWithinOneAccount (line 373) | @Test
method testCorrectWorkflow2HardsOnDifferentProjects (line 405) | @Test
method testCorrectWorkflow3HardsOnDifferentProjectsSameId (line 435) | @Test
FILE: integration-tests/src/test/java/cc/blynk/integration/tcp/CloneWorkFlowTest.java
class CloneWorkFlowTest (line 32) | @RunWith(MockitoJUnitRunner.class)
method deleteTable (line 35) | @Before
method testGetNonExistingQR (line 40) | @Test
method getCloneCode (line 46) | @Test
method getProjectByCloneCode (line 54) | @Test
method getProjectByCloneCodeNew (line 85) | @Test
method getProjectByCloneCodeNewFormat (line 111) | @Test
method getProjectByCloneCodeViaHttp (line 128) | @Test
method getProjectByNonExistingCloneCodeViaHttp (line 152) | @Test
FILE: integration-tests/src/test/java/cc/blynk/integration/tcp/DeviceCommandsTest.java
class DeviceCommandsTest (line 23) | @RunWith(MockitoJUnitRunner.class)
method testAddNewDevice (line 26) | @Test
method testUpdateExistingDevice (line 51) | @Test
method testUpdateNonExistingDevice (line 70) | @Test
method testGetDevices (line 78) | @Test
method testTokenNotUpdatedForExistingDevice (line 92) | @Test
method testDeletedNewlyAddedDevice (line 126) | @Test
method assertEqualDevice (line 164) | private static void assertEqualDevice(Device expected, Device real) {
FILE: integration-tests/src/test/java/cc/blynk/integration/tcp/DeviceSelectorWorkflowTest.java
class DeviceSelectorWorkflowTest (line 42) | @RunWith(MockitoJUnitRunner.class)
method initPort (line 47) | @BeforeClass
method assertEqualDevice (line 52) | private static void assertEqualDevice(Device expected, Device real) {
method testSendHardwareCommandViaDeviceSelector (line 60) | @Test
method testSendHardwareCommandViaDeviceSelectorInSharedApp (line 121) | @Test
method testSetPropertyIsSentForDeviceSelectorWidget (line 211) | @Test
method testSetPropertyIsSentForDeviceSelectorWidgetOnActivateForExistingWidget (line 245) | @Test
method testSetPropertyIsRememberedBetweenDevices (line 257) | @Test
method testBasicSelectorWorkflow (line 303) | @Test
method testDeviceSelectorSyncTimeInput (line 372) | @Test
method testNoSyncForDeviceSelectorWidget (line 441) | @Test
method testDeviceSelectorWorksAfterDeviceRemoval (line 469) | @Test
method terminalWithDeviceSelectorStoreMultipleCommands (line 524) | @Test
method TableWithDeviceSelectorStoreMultipleCommands (line 574) | @Test
method LCDWithDeviceSelectorStoreMultipleCommands (line 621) | @Test
method testDeviceSelectorForSharedApp (line 667) | @Test
FILE: integration-tests/src/test/java/cc/blynk/integration/tcp/DeviceTilesWidgetTest.java
class DeviceTilesWidgetTest (line 80) | @RunWith(MockitoJUnitRunner.class)
method createPageTemplate (line 83) | @Test
method createDeviceTilesAndEditColors (line 120) | @Test
method createPageTemplateWithOutModeField (line 169) | @Test
method createButtonTileTemplate (line 197) | @Test
method createTemplateAndUpdate (line 229) | @Test
method createTemplateAndUpdate2 (line 272) | @Test
method createTemplateAndUpdatePin (line 317) | @Test
method createTemplateAndUpdatePinFor2Templates (line 385) | @Test
method syncForSpecificDeviceTile (line 472) | @Test
method readingWidgetWorksForDeviceTiles (line 600) | @Test
method readingWidgetWorksForAllTilesWithinDeviceTiles (line 674) | @Test
method doNotPerformReadCommandWhenNoReadingWidgetInsideTileTemplate (line 738) | @Test
method deviceRemovalDoesntEraseAllTiles (line 804) | @Test
method addingNewDeviceToTheTilesPreservesTileValue (line 878) | @Test
method addingNewDeviceToTheTilesPreservesTemplateValue (line 953) | @Test
method createTemplateWithTiles (line 1028) | @Test
method checkDeviceTilesWidgetSettingsUpdatedWithoutTemplateAndTilefields (line 1068) | @Test
method createTemplateWithTilesAndDelete (line 1129) | @Test
method deleteTemplate (line 1147) | @Test
method updateTemplateCreateWithWidget (line 1188) | @Test
method getSuperchartGraphWorksForTiles (line 1233) | @Test
method getSuperchartGraphWorksForTiles2 (line 1272) | @Test
method exportSuperchartGraphWorksForTiles (line 1311) | @Test
method energyCalculationsAreCorrectWhenAddingRemovingWidgets (line 1367) | @Test
method updateCommandWorksForWidgetWithinDeviceTiles (line 1416) | @Test
method testHugeWidgetIsCreatedWithinDeviceTiles (line 1457) | @Test
method createpageTempalteWithIdAndSendEmail (line 1512) | @Test
method testAddAndRemoveTabs (line 1562) | @Test
method testAddAndRemoveTabs2 (line 1678) | @Test
method testAddAndUpdateTabs (line 1794) | @Test
method testGetPinViaHttpApiWorksForDeviceTiles (line 1915) | @Test
method testDeviceTileIsUpdatedFromHardware (line 1958) | @Test
method testDeviceTileAndWidgetWithinTemplateHasSamePin (line 1991) | @Test
method testDeviceTileAndWidgetWithinTemplateHasSamePinAndUpdateFromApp (line 2071) | @Test
method testDeviceTileAndWidgetWithinTemplateHasSamePin2 (line 2123) | @Test
method testDeviceTileAndWidgetWithMultipleValues (line 2202) | @Test
method updateViaHttpAPIWorksForDeviceTiles (line 2256) | @Test
FILE: integration-tests/src/test/java/cc/blynk/integration/tcp/DeviceWorkflowTest.java
class DeviceWorkflowTest (line 62) | @RunWith(MockitoJUnitRunner.class)
method initPort (line 67) | @BeforeClass
method testSendHardwareCommandToMultipleDevices (line 72) | @Test
method testDeviceWentOfflineMessage (line 115) | @Test
method testSendHardwareCommandToAppFromMultipleDevices (line 141) | @Test
method testSendDeviceSpecificPMMessage (line 170) | @Test
method testSendPMOnActivateForMultiDevices (line 196) | @Test
method testActivateForMultiDevices (line 238) | @Test
method testTagWorks (line 257) | @Test
method testActivateAndGetSyncForMultiDevices (line 298) | @Test
method testOfflineOnlineStatusForMultiDevices (line 332) | @Test
method testCorrectOnlineStatusForDisconnect (line 374) | @Test
method testCorrectConnectTime (line 401) | @Test
method testCorrectOnlineStatusForReconnect (line 411) | @Test
method testHardwareChannelClosedOnDashRemoval (line 444) | @Test
method testHardwareChannelClosedOnDeviceRemoval (line 475) | @Test
method testHardwareDataRemovedWhenDeviceRemoved (line 524) | @Test
method testTemporaryTokenWorksAsExpected (line 585) | @Test
method testCorrectRemovalForTags (line 632) | @Test
method testCorrectRemovalForDeviceSelector (line 678) | @Test
method assertEqualDevice (line 781) | private static void assertEqualDevice(Device expected, Device real) {
FILE: integration-tests/src/test/java/cc/blynk/integration/tcp/EnergyWorkflowTest.java
class EnergyWorkflowTest (line 27) | @RunWith(MockitoJUnitRunner.class)
method initClientPair (line 30) | @Override
method testReach1500LimitOfEnergy (line 38) | @Test
method testGetEnergy (line 52) | @Test
method testAddEnergy (line 58) | @Test
method testEnergyAfterCreateRemoveProject (line 67) | @Test
method testEnergyAfterCreateRemoveWidget (line 83) | @Test
FILE: integration-tests/src/test/java/cc/blynk/integration/tcp/EventorTest.java
class EventorTest (line 61) | @RunWith(MockitoJUnitRunner.class)
method buildRule (line 64) | private static Rule buildRule(String s, boolean isActive) {
method parsePin (line 91) | private static DataStream parsePin(String pinString) {
method resolveAction (line 97) | private static BaseAction resolveAction(String action, DataStream data...
method resolveCondition (line 112) | private static BaseCondition resolveCondition(String conditionString, ...
method oneRuleEventor (line 131) | public static Eventor oneRuleEventor(String ruleString, boolean isActi...
method oneRuleEventor (line 136) | public static Eventor oneRuleEventor(String ruleString) {
method testSimpleRule1 (line 141) | @Test
method testInactiveEventsNotTriggered (line 154) | @Test
method testSimpleRule1AndDashUpdatedValue (line 167) | @Test
method testSimpleRule2 (line 188) | @Test
method testSimpleRule3 (line 201) | @Test
method testSimpleRule4 (line 214) | @Test
method testSimpleRule5 (line 227) | @Test
method testSimpleRule6 (line 240) | @Test
method testSimpleRule7 (line 253) | @Test
method testSimpleRule8 (line 271) | @Test
method testSimpleRule8Notify (line 289) | @Test
method testSimpleRule8NotifyAndFormat (line 307) | @Test
method testSimpleRule9Twit (line 325) | @Test
method testSimpleRule8Email (line 338) | @Test
method testSimpleRule8EmailAndFormat (line 355) | @Test
method testSimpleRuleCreateUpdateConditionWorks (line 372) | @Test
method testPinModeForEventorAndSetPinAction (line 399) | @Test
method testTriggerOnlyOnceOnCondition (line 420) | @Test
method testEventorWorksForMultipleHardware (line 456) | @Test
method testPinModeForPWMPinForEventorAndSetPinAction (line 477) | @Test
method testSimpleRule2WorksFromAppSide (line 506) | @Test
method testSimpleRuleWith2Actions (line 519) | @Test
method testEventorHasWrongDeviceId (line 543) | @Test
method testStringEqualsRule (line 557) | @Test
method testValueChangedRule (line 576) | @Test
method testStringNotEqualsRule (line 603) | @Test
method testStringEqualsRuleWrongTrigger (line 622) | @Test
method testSetWidgetPropertyViaEventor (line 641) | @Test
FILE: integration-tests/src/test/java/cc/blynk/integration/tcp/FacebookLoginTest.java
class FacebookLoginTest (line 36) | @RunWith(MockitoJUnitRunner.class)
method testLoginWorksForNewUser (line 42) | @Test
method testFacebookLoginWorksForExistingUser (line 68) | @Test
method initFacebookAppAndHardPair (line 73) | private ClientPair initFacebookAppAndHardPair(String host, int appPort...
FILE: integration-tests/src/test/java/cc/blynk/integration/tcp/HistoryGraphTest.java
class HistoryGraphTest (line 88) | @RunWith(MockitoJUnitRunner.class)
method initTempFolder (line 93) | @BeforeClass
method cleanStorage (line 98) | @Before
method testTooManyDataForGraphWorkWithNewProtocol (line 106) | @Test
method testGetGraphDataForTagAndForEnhancedGraph1StreamWithoutData (line 169) | @Test
method testGetGraphDataForTagAndForEnhancedGraphMAX (line 233) | @Test
method testGetGraphDataForTagAndForEnhancedGraphMIN (line 299) | @Test
method testGetGraphDataForTagAndForEnhancedGraphSUM (line 365) | @Test
method testGetGraphDataForTagAndForEnhancedGraphAVG (line 431) | @Test
method testGetGraphDataForTagAndForEnhancedGraphMEDIAN (line 497) | @Test
method testGetGraphDataForTagAndForEnhancedGraphMEDIANFor3Devices (line 563) | @Test
method testGetGraphDataForEnhancedGraphWithEmptyDataStream (line 641) | @Test
method testGetGraphDataForEnhancedGraph (line 673) | @Test
method testGetGraphDataForEnhancedGraphFor2Streams (line 719) | @Test
method testGetGraphDataForEnhancedGraphWithWrongDataStream (line 767) | @Test
method makeSureNoReportingWhenNotAGraphPin (line 800) | @Test
method makeSureReportingIsPresentWhenGraphAssignedToDevice (line 830) | @Test
method makeSureReportingIsPresentWhenGraphAssignedToDevice2 (line 862) | @Test
method makeSureReportingIsPresentWhenGraphAssignedToDeviceTiles (line 898) | @Test
method makeSureReportingIsPresentWhenGraphAssignedToDeviceTilesWith2Pins (line 949) | @Test
method makeSureReportingIsPresentWhenGraphAssignedToDeviceSelector (line 1008) | @Test
method makeSureReportingIsPresentWhenPinAssignedToReporting (line 1061) | @Test
method makeSureReportingIsPresentWhenPinAssignedToReporting2 (line 1094) | @Test
method makeSureReportingIsPresentWhenPinAssignedToReporting3 (line 1128) | @Test
method testGetLIVEGraphDataForEnhancedGraph (line 1163) | @Test
method testNoLiveDataWhenNoGraph (line 1228) | @Test
method testNoLiveDataWhenNoGraph2 (line 1257) | @Test
method testGetLIVEGraphDataForEnhancedGraphWithPaging (line 1324) | @Test
method testPagingWorksForGetEnhancedHistoryDataPartialData (line 1390) | @Test
method testPagingWorksForGetEnhancedHistoryDataFullData (line 1439) | @Test
method testPagingWorksForGetEnhancedHistoryDataFullDataAndSecondPage (line 1490) | @Test
method testPagingWorksForGetEnhancedHistoryDataWhenNoData (line 1529) | @Test
method testDeleteWorksForEnhancedGraph (line 1568) | @Test
method getFileNameByMask (line 1591) | private static String getFileNameByMask(String pattern) {
method latest (line 1597) | private static File latest(File[] files) {
method testExportDataFromHistoryGraph (line 1609) | @Test
method testGeneratedCSVIsCorrect (line 1635) | @Test
method testGeneratedCSVIsCorrectForMultiDevicesNoData (line 1667) | @Test
method cleanNotUsedPinDataWorksAsExpected (line 1687) | @Test
method cleanNotUsedPinDataWorksAsExpectedForSuperChart (line 1732) | @Test
method cleanNotUsedPinDataWorksAsExpectedForReportsWidget (line 1793) | @Test
method cleanNotUsedPinDataWorksAsExpectedForSuperChartInDeviceTiles (line 1857) | @Test
method cleanNotUsedPinDataWorksAsExpectedForSuperChartWithDeviceSelector (line 1934) | @Test
method truncateReportingDataWorks (line 2039) | @Test
method deleteOldExportFiles (line 2093) | @Test
method doNotTruncateFileWithCorrectSize (line 2111) | @Test
method truncateReportingDataDontFailsInEmptyFolder (line 2148) | @Test
method truncateReportingDataDeletesEmptyFolder (line 2164) | @Test
method testGeneratedCSVIsCorrectForMultiDevicesAndEnhancedGraph (line 2180) | @Test
method testGeneratedCSVIsCorrectForMultiDevices (line 2257) | @Test
FILE: integration-tests/src/test/java/cc/blynk/integration/tcp/LoadBalancingIntegrationTest.java
class LoadBalancingIntegrationTest (line 53) | @RunWith(MockitoJUnitRunner.class)
method init (line 68) | @Before
method shutdown (line 88) | @After
method test2NewUsersStoredOnDifferentServers (line 102) | @Test
method testNoGetServerHandlerAfterLogin (line 153) | @Test
method testUserRedirectedToCorrectServer (line 162) | @Test
method testCreateFewAccountWithDifferentApp (line 194) | @Test
method testNoRedirectAsTokenIsWrong (line 219) | @Test
method hardwareCreatedAndServerStoredInDB (line 235) | @Test
method hardwareCreatedAndServerStoredInDBAndDelete (line 249) | @Test
method redirectForHardwareWorks (line 268) | @Test
method redirectForHardwareWorksWithForce80Port (line 282) | @Test
method testInvalidToken (line 296) | @Test
method redirectForHardwareWorksFromCache (line 310) | @Test
method redirectForHardwareDoesntWorkFromInvalidatedCache (line 329) | @Test
method workflowForUser (line 361) | private String workflowForUser(TestAppClient appClient, String usernam...
FILE: integration-tests/src/test/java/cc/blynk/integration/tcp/MainWorkflowTest.java
class MainWorkflowTest (line 89) | @RunWith(MockitoJUnitRunner.class)
method testCloneForLocalServerWithNoDB (line 92) | @Test
method testResetEmail (line 106) | @Test
method testResetEmail2 (line 138) | @Test
method registrationAllowedOnlyOncePerConnection (line 170) | @Test
method createBasicProfile (line 185) | @Test
method testNoEmptyPMCommands (line 250) | @Test
method doNotAllowUsersWithQuestionMark (line 297) | @Test
method createDashWithDevices (line 307) | @Test
method testRegisterWithAnotherApp (line 340) | @Test
method testDoubleLogin (line 367) | @Test
method testDoubleLogin2 (line 373) | @Test
method sendCommandBeforeLogin (line 383) | @Test
method testForwardBluetoothFromAppWorks (line 397) | @Test
method testValueForPWMPinForStteperIsAccepted (line 414) | @Test
method testSendInvalidVirtualPin (line 431) | @Test
method testSendInvalidVirtualPin2 (line 437) | @Test
method testSendValidVirtualPin (line 443) | @Test
method testNoEnergyDrainForBusinessApps (line 451) | @Test
method testPingCommandWorks (line 488) | @Test
method testAddAndRemoveTabs (line 494) | @Test
method testAddAndUpdateTabs (line 533) | @Test
method testPurchaseEnergy (line 573) | @Test
method testApplicationPingCommandOk (line 597) | @Test
method testHardPingCommandOk (line 608) | @Test
method testDashCommands (line 617) | @Test
method testHardwareChannelClosedOnDashRemoval (line 680) | @Test
method testGetTokenWorksWithNewFormats (line 713) | @Test
method deleteDashDeletesTokensAlso (line 740) | @Test
method loadGzippedProfile (line 771) | @Test
method settingsUpdateCommand (line 786) | @Test
method testSendUnicodeChar (line 806) | @Test
method testAppSendAnyHardCommandAndBack (line 812) | @Test
method testAppNoActiveDashForHard (line 821) | @Test
method testHardwareSendsWrongCommand (line 833) | @Test
method testAppChangeActiveDash (line 842) | @Test
method testActive2AndDeactivate1 (line 870) | @Test
method testActivateWorkflow (line 913) | @Test
method testTweetNotWorks (line 928) | @Test
method testSmsWorks (line 951) | @Test
method testTweetWorks (line 972) | @Test
method testPlayerUpdateWorksAsExpected (line 981) | @Test
method testTimeInputUpdateWorksAsExpected (line 1009) | @Test
method testTimeInputUpdateWorksAsExpectedFromHardSide (line 1109) | @Test
method testWrongCommandForAggregation (line 1210) | @Test
method testWrongPin (line 1216) | @Test
method testAppSendWAwWorks (line 1222) | @Test
method testClosedConnectionWhenNotLogged (line 1230) | @Test
method testRefreshTokenClosesExistingConnections (line 1242) | @Test
method testSendPinModeCommandWhenHardwareGoesOnline (line 1249) | @Test
method testSendGeneratedPinModeCommandWhenHardwareGoesOnline (line 1270) | @Test
method testSendHardwareCommandToNotActiveDashboard (line 1291) | @Test
method testConnectAppAndHardwareAndSendCommands (line 1322) | @Test
method testTryReachQuotaLimit (line 1331) | @Test
method testCreateProjectWithDevicesGeneratesNewTokens (line 1365) | @Test
method testButtonStateInPWMModeIsStored (line 1392) | @Test
method testTwoWidgetsOnTheSamePin (line 1407) | @Test
method testButtonStateInPWMModeIsStoredWithUIHack (line 1444) | @Test
method testOutdatedAppNotificationAlertWorks (line 1459) | @Test
method testOutdatedAppNotificationNotTriggered (line 1471) | @Test
method newUserReceivesGrettingEmailAndNoIPLogged (line 1483) | @Test
method test (line 1503) | @Test
FILE: integration-tests/src/test/java/cc/blynk/integration/tcp/MultiAppTest.java
class MultiAppTest (line 31) | @RunWith(MockitoJUnitRunner.class)
method testCreateFewAccountWithDifferentApp (line 34) | @Test
method workflowForUser (line 72) | private String workflowForUser(TestAppClient appClient, String email, ...
FILE: integration-tests/src/test/java/cc/blynk/integration/tcp/NotificationsLogicTest.java
class NotificationsLogicTest (line 47) | @RunWith(MockitoJUnitRunner.class)
method initPort (line 52) | @BeforeClass
method addPushTokenWrongInput (line 57) | @Test
method addPushTokenWorksForAndroid (line 76) | @Test
method addPushTokenNotOverridedOnProfileSave (line 93) | @Test
method addPushTokenWorksForIos (line 124) | @Test
method testHardwareDeviceWentOffline (line 150) | @Test
method testHardwareDeviceWentOfflineForSecondDeviceSameToken (line 163) | @Test
method testHardwareDeviceWentOfflineForSecondDeviceNewToken (line 181) | @Test
method testHardwareDeviceWentOfflineAndPushWorks (line 211) | @Test
method testNotifWidgetOverrideProjectSetting (line 231) | @Test
method testNoOfflineNotifsExpected (line 256) | @Test
method testOfflineNotifsExpectedButNotPush (line 275) | @Test
method testHardwareDeviceWentOfflineAndPushNotWorksForLogoutUser (line 294) | @Test
method testHardwareDeviceWentOfflineAndPushNotWorksForLogoutUserWithUID (line 314) | @Test
method testHardwareDeviceWentOfflineAndPushNotWorksForLogoutUserWithWrongUID (line 334) | @Test
method testHardwareDeviceWentOfflineAndPushNotWorksForLogoutUser2 (line 351) | @Test
method testLoginWith2AppsAndLogoutFrom1 (line 394) | @Test
method testLoginWith2AppsAndLogoutFrom2 (line 424) | @Test
method testLoginWithSharedAppAndLogoutFrom (line 453) | @Test
method testHardwareDeviceWentOfflineAndPushDelayedWorks (line 483) | @Test
method testHardwareDeviceWentOfflineAndPushDelayedNotTriggeredDueToReconnect (line 508) | @Test
method testCreateNewNotificationWidget (line 533) | @Test
method testPushWhenHardwareOffline (line 558) | @Test
method testPushHandler (line 571) | @Test
method testPushHandlerWithPlaceHolder (line 583) | @Test
method testOfflineMessageIsSentToBothApps (line 595) | @Test
method multipleAccountsOnTheSameDevice (line 611) | @Test
FILE: integration-tests/src/test/java/cc/blynk/integration/tcp/OfflineNotificationTest.java
class OfflineNotificationTest (line 34) | @RunWith(MockitoJUnitRunner.class)
method initPort (line 39) | @BeforeClass
method changeProfileTo (line 44) | @Override
method testOfflineTimingIsCorrectForMultipleDevices (line 49) | @Test
method testOfflineTimingIsCorrectForMultipleDevices2 (line 88) | @Test
method testTurnOffNotifications (line 122) | @Test
method testTurnOffNotificationsAndNoDevices (line 178) | @Test
method deviceGoesOfflineAfterBeingIdle (line 193) | @Test
method sessionDisconnectChangeState (line 221) | @Test
FILE: integration-tests/src/test/java/cc/blynk/integration/tcp/PortUnificationTest.java
class PortUnificationTest (line 22) | @RunWith(MockitoJUnitRunner.class)
method testAppConectsOk (line 25) | @Test
method testHardwareConnectsOk (line 37) | @Test
FILE: integration-tests/src/test/java/cc/blynk/integration/tcp/PublishingPreviewFlow.java
class PublishingPreviewFlow (line 71) | @RunWith(MockitoJUnitRunner.class)
method deleteTable (line 74) | @Before
method testGetProjectByToken (line 79) | @Test
method testSendStaticEmailForAppPublish (line 108) | @Test
method testSendDynamicEmailForAppPublish (line 140) | @Test
method testSendDynamicEmailForAppPublishAndNoDevices (line 165) | @Test
method testSendDynamicEmailForAppPublishWithFewDevices (line 195) | @Test
method testFaceEditNotAllowedHasNoChild (line 225) | @Test
method testFaceUpdateWorks (line 231) | @Test
method testUpdateFaceDoesntEraseExistingDeviceTiles (line 301) | @Test
method testDeviceTilesAreNotCopiedFromParentProjectOnCreationAndFaceUpdate (line 431) | @Test
method testChildProjectDoesntGetParentValues (line 508) | @Test
method testFaceEditForRestrictiveFields (line 627) | @Test
method testDeleteWorksForPreviewApp (line 717) | @Test
method testDeleteWorksForParentOfPreviewApp (line 767) | @Test
method testExportedAppFlowWithOneDynamicTest (line 821) | @Test
method testFullDynamicAppFlow (line 856) | @Test
method testTimeInputInTheFaceAndDeviceTilesIsNotErasedByParentFaceUpdate (line 926) | @Test
method makeQRs (line 1058) | private QrHolder[] makeQRs(Device[] devices, int dashId) throws Except...
method getFlashedTokenByDevice (line 1073) | private FlashedToken getFlashedTokenByDevice() throws Exception {
method getAllTokens (line 1086) | private List<FlashedToken> getAllTokens() throws Exception {
FILE: integration-tests/src/test/java/cc/blynk/integration/tcp/ReadingWorkflowTest.java
class ReadingWorkflowTest (line 37) | @RunWith(MockitoJUnitRunner.class)
method initPort (line 43) | @BeforeClass
method initSES (line 48) | @Before
method closeSES (line 53) | @After
method testReadingCommandNotAcceptedAnymoreFromApp (line 58) | @Test
method testServerSendReadingCommandWithReadingWorkerEnabled (line 64) | @Test
method testServerSendReadingCommandCorrectly (line 71) | @Test
method testServerDontSendReadingCommandsForNonActiveDash (line 81) | @Test
method testSendReadCommandsForLCD (line 94) | @Test
method testSendReadForMultipleDevices (line 115) | @Test
method testSendReadForDeviceSelector (line 146) | @Test
method testSendReadForMultipleDevices2 (line 184) | @Test
method testSendReadOnlyForOnlineApp (line 240) | @Test
FILE: integration-tests/src/test/java/cc/blynk/integration/tcp/RegistrationLimitCheckTest.java
class RegistrationLimitCheckTest (line 11) | public class RegistrationLimitCheckTest extends SingleServerInstancePerT...
method registrationLimitCheck (line 13) | @Test
FILE: integration-tests/src/test/java/cc/blynk/integration/tcp/ReportingTest.java
class ReportingTest (line 84) | @RunWith(MockitoJUnitRunner.class)
method init (line 91) | @Before
method shutdown (line 100) | @After
method testDeleteAllDeviceData (line 107) | @Test
method testDeleteDeviceDataFor1Device (line 144) | @Test
method testDeleteDeviceDataForSpecificPin (line 181) | @Test
method createReportCRUD (line 231) | @Test
method testDailyReportIsTriggered (line 285) | @Test
method testReportIdRemovedFromScheduler (line 383) | @Test
method testReportIdRemovedFromSchedulerWhenDashIsRemoved (line 461) | @Test
method testDailyReportWithSinglePointIsTriggeredAndNullName (line 525) | @Test
method testDailyReportWith24PointsCorrectlyFetched (line 606) | @Test
method testFinalFileNameCSVPerDevicePerPin (line 674) | @Test
method testFinalFileNameCSVPerDevice (line 755) | @Test
method testFinalFileNameCSVPerDeviceUtf8 (line 844) | @Test
method testFinalFileNameCSVPerDevice2 (line 933) | @Test
method testFinalFileNameCSVPerDeviceUnicode (line 1033) | @Test
method testFinalFileNameCSVPerDevice2DataStreamWithName (line 1119) | @Test
method testFinalFileNameCSVMerged2DataStreamWithName (line 1219) | @Test
method testFinalFileNameCSVMerged2DataStreamWithNameCorrectEscaping (line 1312) | @Test
method testFinalFileNameCSVMerged2DataStreamWithNameCorrectEscaping2 (line 1405) | @Test
method testDailyReportWithSinglePointIsTriggeredAndExpired (line 1498) | @Test
method testOneTimeReportIsTriggered (line 1570) | @Test
method testOneTimeReportWithWrongSources (line 1649) | @Test
method testMultipleReceiversFroOneTimeReport (line 1733) | @Test
method testStreamsAreCorrectlyFiltered (line 1812) | @Test
method testExportIsLimited (line 1901) | @Test
method testOneTimeReportIsTriggeredWithAnotherFormat (line 1958) | @Test
method testOneTimeReportIsTriggeredWithCustomJson (line 2033) | @Test
method testOneTimeReportIsTriggeredAndNoData (line 2064) | @Test
method testOneTimeReportIsTriggeredAndNoData2 (line 2112) | @Test
method testExpiredReportIsNotAddedToTheProject (line 2170) | @Test
method testExpiredReportIsNotAddedToTheProject2 (line 2217) | @Test
method testDailyReportWithSinglePointIsTriggeredAndOneRecordIsFiltered (line 2263) | @Test
method readStringFromFirstZipEntry (line 2336) | private String readStringFromFirstZipEntry(Path path) throws Exception {
method readStringFromZipEntry (line 2348) | private String readStringFromZipEntry(ZipFile zipFile, ZipEntry entry)...
FILE: integration-tests/src/test/java/cc/blynk/integration/tcp/SetPropertyTest.java
class SetPropertyTest (line 44) | @RunWith(MockitoJUnitRunner.class)
method testSetWidgetProperty (line 47) | @Test
method testSetWidgetPropertyIsNotRestoredForTagWidgetAfterOverriding (line 69) | @Test
method testSetButtonProperty (line 111) | @Test
method testSetBooleanProperty (line 137) | @Test
method testSetStringArrayWidgetPropertyForMenu (line 158) | @Test
method testSetWrongWidgetProperty (line 179) | @Test
method testSetWrongWidgetProperty2 (line 197) | @Test
method testSetWrongWidgetProperty3 (line 215) | @Test
method testSetColorForWidget (line 230) | @Test
method setMinMaxProperty (line 244) | @Test
method setMinMaxPropertyFloat (line 263) | @Test
method setMinMaxWrongPropertyFloat (line 282) | @Test
method testSetColorShouldNotWorkForNonActiveProject (line 292) | @Test
method testSetUrlForVideo (line 302) | @Test
method testSetUrlsForImageWidget (line 323) | @Test
method testSetUrlForImageWidget (line 359) | @Test
method testPropertyIsNotRestoredAfterWidgetCreated (line 395) | @Test
method testPropertyIsNotRestoredAfterWidgetUpdated (line 411) | @Test
method testStepPropertyForStepWidget (line 447) | @Test
method testSetColorForWidgetFromApp (line 468) | @Test
FILE: integration-tests/src/test/java/cc/blynk/integration/tcp/ShareProfileWorkflowTest.java
class ShareProfileWorkflowTest (line 67) | @RunWith(MockitoJUnitRunner.class)
method getWidgetByPin (line 70) | private static OnePinWidget getWidgetByPin(Profile profile, int pin) {
method testGetShareTokenNoDashId (line 82) | @Test
method testGetShareToken (line 88) | @Test
method getShareTokenAndLoginViaIt (line 134) | @Test
method getShareMultipleTokensAndLoginViaIt (line 183) | @Test
method testSharingChargingCorrect (line 253) | @Test
method checkStateWasChanged (line 291) | @Test
method checkSetPropertyWasChanged (line 353) | @Test
method checkSharingMessageWasReceived (line 371) | @Test
method checkSharingMessageWasReceivedMultipleRecievers (line 391) | @Test
method checkSharingMessageWasReceivedAlsoForNonSharedApp (line 418) | @Test
method eventorWorksInSharedModeFromAppSide (line 445) | @Test
method checkBothClientsReceiveMessage (line 482) | @Test
method wrongSharedToken (line 515) | @Test
method revokeSharedToken (line 530) | @Test
method testDeactivateAndActivateForSubscriptions (line 567) | @Test
method testDeactivateOnLogout (line 599) | @Test
method loadGzippedProfileForSharedBoard (line 625) | @Test
method loadGzippedDashForSharedBoard (line 673) | @Test
method compress (line 722) | public static byte[] compress(String value) throws IOException {
method testGetShareTokenAndRefresh (line 733) | @Test
method testMasterMasterSyncWorksWithoutToken (line 791) | @Test
method checkLogoutCommandForSharedApp (line 806) | @Test
method testSharedProjectDoesntReceiveCommandFromOtherProjects (line 835) | @Test
method clearPrivateData (line 865) | private static void clearPrivateData(Notification n) {
method clearPrivateData (line 870) | private static void clearPrivateData(Twitter t) {
FILE: integration-tests/src/test/java/cc/blynk/integration/tcp/SimplePerformanceTest.java
class SimplePerformanceTest (line 31) | @RunWith(MockitoJUnitRunner.class)
method initTP (line 36) | @Before
method testConnectAppAndHardware (line 41) | @Test
method initClientsWithSharedNio (line 75) | private ClientPair initClientsWithSharedNio(String host, int appPort, ...
FILE: integration-tests/src/test/java/cc/blynk/integration/tcp/SyncWorkflowTest.java
class SyncWorkflowTest (line 52) | @RunWith(MockitoJUnitRunner.class)
method testHardSyncReturnHardwareCommands (line 55) | @Test
method testHardSyncReturnNoSetPropertyCommands (line 69) | @Test
method testHardSyncReturnNothingNoWidgetOnPin (line 79) | @Test
method testHardSyncReturnValueForNoWidgetOnVirtualPin (line 85) | @Test
method testHardSyncReturnValueForNoWidgetOnAnalogPin (line 107) | @Test
method testHardSyncReturn1HardwareCommand (line 129) | @Test
method testLCDOnActivateSendsCorrectBodySimpleMode (line 135) | @Test
method testLCDOnActivateSendsCorrectBodyAdvancedMode (line 168) | @Test
method testHardSyncReturnRTCWithoutTimezone (line 203) | @Test
method testHardSyncReturnRTCWithUTCTimezone (line 223) | @Test
method testWrongAsiaTimeZone (line 248) | @Test(expected = DateTimeException.class)
method testCorrectAsiaTimeZone (line 253) | @Test
method testHardSyncReturnRTCWithUTCTimezonePlus3 (line 258) | @Test
method testHardSyncReturnRTCWithUTCTimezoneMinus3 (line 288) | @Test
method testHardSyncForTimeInputWidget (line 317) | @Test
method testSyncForTimer (line 341) | @Test
method testTerminalSendsSyncOnActivate (line 377) | @Test
method testLCDSendsSyncOnActivate (line 404) | @Test
method testLCDSendsSyncOnActivate2 (line 419) | @Test
method testSyncWorksForGauge (line 449) | @Test
method testSyncForMultiPins (line 461) | @Test
method testActivateAndGetSync (line 477) | @Test
method testSyncForMultiDevices (line 497) | @Test
method testSyncForMultiDevicesNoWidget (line 532) | @Test
method testHardSyncSinglePinFor2DEvices (line 569) | @Test
FILE: integration-tests/src/test/java/cc/blynk/integration/tcp/TableCommandsTest.java
class TableCommandsTest (line 31) | @RunWith(MockitoJUnitRunner.class)
method testAllTableCommands (line 34) | @Test
method testTableUpdateExistingRow (line 140) | @Test
method testTableRowLimit (line 191) | @Test
method testTableAcceptsOnlyUniqueIds (line 228) | @Test
method loadTable (line 258) | private Table loadTable() throws Exception {
FILE: integration-tests/src/test/java/cc/blynk/integration/tcp/TagCommandsTest.java
class TagCommandsTest (line 35) | @RunWith(MockitoJUnitRunner.class)
method testAddNewTag (line 38) | @Test
method testUpdateExistingDevice (line 61) | @Test
method testUpdateNonExistingTag (line 92) | @Test
method testUpdateTagWithSameName (line 100) | @Test
method testDeletedNewlyAddedTag (line 120) | @Test
method testAddNewTagForMultipleDevicesAndAssignWidgetAndVerifySync (line 155) | @Test
method assertEqualTag (line 222) | private static void assertEqualTag(Tag expected, Tag real) {
FILE: integration-tests/src/test/java/cc/blynk/integration/tcp/TimerTest.java
class TimerTest (line 65) | @RunWith(MockitoJUnitRunner.class)
method initSES (line 70) | @Before
method closeSES (line 75) | @After
method testTimerEvent (line 81) | @Test
method testTimerEventNotActive (line 109) | @Test
method testTimerEventWithMultiActions (line 157) | @Test
method testTimerEventWithMultiActions1 (line 191) | @Test
method testIsTimeMethod (line 226) | @Test
method testTimerEventWithWrongDayDontWork (line 234) | @Test
method testAddTimerWidgetWithStartTimeTriggered (line 268) | @Test
method testAddTimerWidgetWithStopAndStartTimeTriggered (line 291) | @Test
method testAddTimerWidgetWithStopTimeTriggered (line 314) | @Test
method testAddTimerWidgetWithStopTimeAndRemove (line 341) | @Test
method testAddFewTimersWidgetWithStartTimeTriggered (line 368) | @Test
method testAddTimerWithSameStartStopTriggered (line 398) | @Test
method testUpdateTimerWidgetWithStopTimeTriggered (line 424) | @Test
method testStopTimerTrigger (line 456) | @Test
method testDashTimerNotTriggered (line 489) | @Test
method testTimerWidgetTriggeredAndSendCommandToCorrectDevice (line 518) | @Test
method testTimerWidgetTriggered (line 571) | @Test
method testTimerWorksWithTag (line 607) | @Test
method testTimerWidgetTriggeredAndSyncWorks (line 660) | @Test
method testAddTimerWidgetToDeviceTilesWithStartTimeTriggered (line 702) | @Test
FILE: integration-tests/src/test/java/cc/blynk/integration/tcp/WebhookTest.java
class WebhookTest (line 51) | @RunWith(MockitoJUnitRunner.class)
method init (line 57) | @BeforeClass
method closeHttpClient (line 75) | @AfterClass
method testThingsSpeakIntegrationTest (line 80) | @Test
method testSome3dPartyWeatherServiceTest (line 96) | @Test
method testSome3dPartyWeatherServiceTriggerFromAppTest (line 114) | @Test
method testReservedREgexCharForReplaceArgumentsInWebhook (line 134) | @Test
method testWebhookWorksWithBlynkHttpApiNoPlaceHolder (line 161) | @Test
method testWebhookWorksWithBlynkHttpApiPlaceHolderAndTextPlain (line 188) | @Test
method testWebhookWorksWithBlynkHttpApiWithArrayPlaceholderInURL (line 212) | @Test
method testWebhookWorksWithBlynkHttpApiWithArray10PlaceholdersInURL (line 240) | @Test
method testWebhookWorksWithBlynkHttpApiWithDateTimePlaceholder (line 279) | @Test
method testWebhookWorksWithBlynkHttpApiWithDateTimePlaceholderAndPins (line 307) | @Test
method testWebhookWorksWithBlynkHttpApiWithPlaceholder (line 341) | @Test
method testWebhookWorksWithBlynkHttpApiWithArrayPlaceholder (line 368) | @Test
method testWebhookWorksWithBlynkHttpApiWithArrayPlaceholder2 (line 397) | @Test
method testWebhookWorksWithBlynkHttpApiWithPlaceholderQuotaLimit (line 424) | @Test
method testWebhookWorksWithBlynkHttpApiNoPlaceHolderAppSideTrigger (line 474) | @Test
method testWebhookWorksWithBlynkHttpApiAppSideTriggerCheckLimit (line 502) | @Test
method testWebhookInvalidUrl (line 552) | @Test
method testWebhookWorksWithUrlPlaceholder (line 581) | @Test
method testWebhookWorksWithUrlPlaceholder2 (line 609) | @Test
FILE: integration-tests/src/test/java/cc/blynk/integration/tcp/WidgetWorkflowTest.java
class WidgetWorkflowTest (line 40) | @RunWith(MockitoJUnitRunner.class)
method deleteFolder (line 43) | @Before
method testCorrectBehaviourOnWrongInput (line 48) | @Test
method testCanCreateWebHookWithScheme (line 72) | @Test
method testWidgetAlreadyExists (line 81) | @Test
method testWidgetWrongSize (line 87) | @Test
method testCreateWidgetBadFormat (line 93) | @Test
method testCreateWidgetAndRemove (line 99) | @Test
method testPinStorageIsCleanedOnWidgetRemoval (line 108) | @Test
method testCreateWidgetAndRemoveWithDeviceTiles (line 146) | @Test
method testWidgetValueNotChangedAfterUpdate (line 165) | @Test
FILE: integration-tests/src/test/java/cc/blynk/integration/tools/FlahsedTokenGenerator.java
class FlahsedTokenGenerator (line 20) | public class FlahsedTokenGenerator {
method main (line 22) | public static void main(String[] args) throws Exception{
method generateTokens (line 34) | private static FlashedToken[] generateTokens(String email, int count, ...
method generateQR (line 48) | private static void generateQR(String text, Path outputFile) throws Ex...
FILE: integration-tests/src/test/java/cc/blynk/integration/tools/ProjectTokenGenerator.java
class ProjectTokenGenerator (line 26) | public class ProjectTokenGenerator {
method main (line 28) | public static void main(String[] args) throws Exception {
method write (line 60) | private static void write(String outputPath, Collection<String> tokens...
method write (line 65) | private static void write(Path path, Collection<String> tokens) throws...
method write (line 74) | private static void write(Path path, String profile) throws IOException {
FILE: integration-tests/src/test/java/cc/blynk/integration/tools/QRGenerator.java
class QRGenerator (line 24) | public class QRGenerator {
method main (line 26) | public static void main(String[] args) throws Exception {
method generateQR (line 32) | private static List<Redeem> generateQR(int count, String outputFolder,...
method generateQR (line 46) | private static void generateQR(String text, Path outputFile) throws Ex...
FILE: integration-tests/src/test/java/cc/blynk/integration/tools/TokenGenerator.java
class TokenGenerator (line 19) | public class TokenGenerator {
method main (line 21) | public static void main(String[] args) throws Exception {
method generate (line 34) | private static Set<String> generate(int amount) {
method write (line 46) | private static void write(String outputPath, Set<String> tokens) throw...
method write (line 51) | private static void write(Path path, Set<String> tokens) throws IOExce...
FILE: integration-tests/src/test/java/cc/blynk/integration/tools/UserReader.java
class UserReader (line 13) | public class UserReader {
method main (line 15) | public static void main(String[] args) throws Exception {
FILE: integration-tests/src/test/java/cc/blynk/integration/websocket/WebSocketTest.java
class WebSocketTest (line 33) | @RunWith(MockitoJUnitRunner.class)
method shutdown (line 44) | @After
method init (line 52) | @Before
method getDataFolder (line 60) | @Override
method testAppWebDashSocketLogin (line 65) | @Test
method testBasicWebSocketCommandsOk2 (line 76) | @Test
method testBasicWebSocketCommandsOk (line 86) | @Test
method testSslBasicWebSocketCommandsOk (line 96) | @Test
method testSyncBetweenWebSocketsAndAppWorks (line 106) | @Test
method testSyncBetweenWebSocketsAndAppWorksLoop (line 144) | @Test
FILE: server/acme/src/main/java/cc/blynk/server/acme/AcmeClient.java
class AcmeClient (line 28) | public class AcmeClient {
method AcmeClient (line 53) | public AcmeClient(String email, String host, ContentHolder contentHold...
method AcmeClient (line 57) | public AcmeClient(String letsEncryptUrl, String email, String host, Co...
method requestCertificate (line 64) | public void requestCertificate() throws Exception {
method fetchCertificate (line 76) | private void fetchCertificate(String contact, String domain) throws IO...
method loadOrCreateKeyPair (line 143) | private KeyPair loadOrCreateKeyPair(File file) throws IOException {
method authorize (line 164) | private void authorize(Authorization auth) throws AcmeException {
method httpChallenge (line 206) | private Http01Challenge httpChallenge(Authorization auth) throws AcmeE...
FILE: server/acme/src/main/java/cc/blynk/server/acme/ContentHolder.java
class ContentHolder (line 8) | public class ContentHolder {
FILE: server/core/src/main/java/cc/blynk/server/Holder.java
class Holder (line 46) | public class Holder {
method Holder (line 89) | public Holder(ServerProperties serverProperties, MailProperties mailPr...
method Holder (line 161) | public Holder(ServerProperties serverProperties, TwitterWrapper twitte...
method disableNettyLeakDetector (line 218) | private static void disableNettyLeakDetector() {
method close (line 226) | public void close() {
FILE: server/core/src/main/java/cc/blynk/server/Limits.java
class Limits (line 13) | public class Limits {
method Limits (line 37) | public Limits(ServerProperties props) {
method isUnlimited (line 63) | private static int isUnlimited(int val, int max) {
method isUnlimited (line 70) | private static long isUnlimited(long val, long max) {
FILE: server/core/src/main/java/cc/blynk/server/SslContextHolder.java
class SslContextHolder (line 24) | public class SslContextHolder {
method SslContextHolder (line 40) | SslContextHolder(ServerProperties props, String email) {
method isOpenSslAvailable (line 89) | static boolean isOpenSslAvailable() {
method regenerate (line 93) | public void regenerate() throws Exception {
method runRenewalWorker (line 103) | public boolean runRenewalWorker() {
method generateInitialCertificates (line 107) | public void generateInitialCertificates(ServerProperties props) {
method initSslContext (line 121) | private SslContext initSslContext(String serverCertPath, String server...
method fetchSslProvider (line 143) | private static SslProvider fetchSslProvider() {
method build (line 147) | public static SslContext build(SslProvider sslProvider) throws Certifi...
method build (line 154) | public SslContext build(File serverCert, File serverKey,
method build (line 170) | public static SslContext build(File serverCert, File serverKey, String...
FILE: server/core/src/main/java/cc/blynk/server/TextHolder.java
class TextHolder (line 19) | public class TextHolder {
method TextHolder (line 31) | TextHolder(GCMProperties gcmProperties) {
FILE: server/core/src/main/java/cc/blynk/server/common/BaseSimpleChannelInboundHandler.java
class BaseSimpleChannelInboundHandler (line 21) | public abstract class BaseSimpleChannelInboundHandler<I> extends Channel...
method BaseSimpleChannelInboundHandler (line 27) | protected BaseSimpleChannelInboundHandler(Class<I> type) {
method getMsgId (line 31) | private static int getMsgId(Object o) {
method channelRead (line 38) | @Override
method messageReceived (line 67) | public abstract void messageReceived(ChannelHandlerContext ctx, I msg);
method getState (line 69) | public abstract StateHolderBase getState();
method exceptionCaught (line 71) | @Override
FILE: server/core/src/main/java/cc/blynk/server/common/handlers/AlreadyLoggedHandler.java
class AlreadyLoggedHandler (line 19) | @ChannelHandler.Sharable
method channelRead0 (line 24) | @Override
method exceptionCaught (line 38) | @Override
FILE: server/core/src/main/java/cc/blynk/server/common/handlers/UserNotLoggedHandler.java
class UserNotLoggedHandler (line 19) | @ChannelHandler.Sharable
method channelRead0 (line 24) | @Override
method exceptionCaught (line 35) | @Override
FILE: server/core/src/main/java/cc/blynk/server/common/handlers/logic/PingLogic.java
class PingLogic (line 13) | public final class PingLogic {
method PingLogic (line 15) | private PingLogic() {
method messageReceived (line 18) | public static void messageReceived(ChannelHandlerContext ctx, int mess...
FILE: server/core/src/main/java/cc/blynk/server/core/BlockingIOProcessor.java
class BlockingIOProcessor (line 20) | public class BlockingIOProcessor implements Closeable {
method BlockingIOProcessor (line 38) | public BlockingIOProcessor(int poolSize, int maxQueueSize) {
method execute (line 73) | public void execute(Runnable task) {
method executeDB (line 77) | public void executeDB(Runnable task) {
method executeReportingDB (line 81) | public void executeReportingDB(Runnable task) {
method executeHistory (line 85) | public void executeHistory(Runnable task) {
method executeDBGetServer (line 89) | public void executeDBGetServer(Runnable task) {
method close (line 93) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/dao/CSVGenerator.java
class CSVGenerator (line 29) | public class CSVGenerator {
method CSVGenerator (line 36) | CSVGenerator(ReportingDiskDao reportingDao) {
method createCSV (line 40) | public Path createCSV(User user, int dashId, int inDeviceId, PinType p...
method generateExportCSVPath (line 70) | private static Path generateExportCSVPath(String email, int dashId, in...
method format (line 77) | private static String format(String email, int dashId, int deviceId, P...
FILE: server/core/src/main/java/cc/blynk/server/core/dao/FileManager.java
class FileManager (line 44) | public class FileManager {
method FileManager (line 62) | public FileManager(String dataFolder, String host) {
method getDataDir (line 100) | public Path getDataDir() {
method generateFileName (line 104) | public Path generateFileName(String email, String appName) {
method generateBackupFileName (line 108) | public Path generateBackupFileName(String email, String appName) {
method generateOldFileName (line 113) | private Path generateOldFileName(String userName) {
method delete (line 117) | public boolean delete(String email, String appName) {
method overrideUserFile (line 128) | public void overrideUserFile(User user) throws IOException {
method removeOldFile (line 136) | private void removeOldFile(String email) {
method deserializeUsers (line 151) | public ConcurrentMap<UserKey, User> deserializeUsers() {
method restoreFromBackup (line 186) | private Stream<User> restoreFromBackup(Path restoreFileNamePath) {
method makeProfileChanges (line 217) | public void makeProfileChanges(User user) {
method getUserProfilesSize (line 242) | public Map<String, Integer> getUserProfilesSize() {
method writeCloneProjectToDisk (line 255) | public boolean writeCloneProjectToDisk(String token, String json) {
method readClonedProjectFromDisk (line 266) | public String readClonedProjectFromDisk(String token) {
FILE: server/core/src/main/java/cc/blynk/server/core/dao/RegularTokenManager.java
class RegularTokenManager (line 18) | class RegularTokenManager {
method RegularTokenManager (line 24) | RegularTokenManager(Collection<User> users) {
method assignToken (line 40) | String assignToken(User user, DashBoard dash, Device device, String ne...
method deleteDeviceToken (line 59) | String deleteDeviceToken(String deviceToken) {
method getUserByToken (line 67) | TokenValue getUserByToken(String token) {
method deleteProject (line 71) | String[] deleteProject(DashBoard dash) {
FILE: server/core/src/main/java/cc/blynk/server/core/dao/ReportingDiskDao.java
class ReportingDiskDao (line 46) | public class ReportingDiskDao implements Closeable {
method ReportingDiskDao (line 62) | public ReportingDiskDao(String reportingFolder, AverageAggregatorProce...
method ReportingDiskDao (line 72) | public ReportingDiskDao(String reportingFolder, boolean isEnabled) {
method createCSVFolder (line 82) | private static void createCSVFolder() {
method getByteBufferFromDisk (line 90) | public ByteBuffer getByteBufferFromDisk(User user, int dashId, int dev...
method hasData (line 109) | private static boolean hasData(byte[][] data) {
method getDataForTag (line 118) | private ByteBuffer getDataForTag(User user, GraphPinRequest graphPinRe...
method addBufferToResult (line 133) | private static void addBufferToResult(TreeMap<Long, GraphFunction> data,
method toByteBuf (line 150) | private static ByteBuffer toByteBuf(TreeMap<Long, GraphFunction> data) {
method getByteBufferFromDisk (line 159) | private ByteBuffer getByteBufferFromDisk(User user, GraphPinRequest gr...
method getUserReportingFolderPath (line 177) | private Path getUserReportingFolderPath(User user) {
method delete (line 181) | public int delete(User user) {
method delete (line 185) | public int delete(User user, Function<Path, Boolean> filter) {
method containsPrefix (line 208) | private static boolean containsPrefix(List<String> prefixes, String fi...
method generateFilename (line 217) | private static String generateFilename(int dashId, int deviceId, char ...
method generateFilenamePrefix (line 221) | private static String generateFilenamePrefix(int dashId, int deviceId,...
method generateFilenamePrefix (line 225) | private static String generateFilenamePrefix(int dashId, int deviceId) {
method delete (line 229) | private static void delete(String userReportingDir, int dashId, int de...
method generateFilename (line 236) | public static String generateFilename(int dashId, int deviceId,
method delete (line 241) | public int delete(User user, int dashId, int deviceId, String[] pins) ...
method delete (line 262) | public int delete(User user, int dashId, int deviceId) throws IOExcept...
method delete (line 281) | public void delete(User user, int dashId, int deviceId, PinType pinTyp...
method process (line 290) | public void process(User user, DashBoard dash, int deviceId, short pin...
method process (line 300) | private void process(User user, DashBoard dash, int deviceId, short pi...
method getReportingData (line 326) | public byte[][] getReportingData(User user, GraphPinRequest[] requeste...
method close (line 350) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/dao/SessionDao.java
class SessionDao (line 28) | public class SessionDao {
method get (line 35) | public Session get(UserKey userKey) {
method getOrCreateSessionByUser (line 40) | public Session getOrCreateSessionByUser(UserKey key, EventLoop initial...
method generateNewSession (line 61) | public String generateNewSession(User user) {
method isValid (line 67) | public boolean isValid(Cookie cookie) {
method getUserFromCookie (line 71) | public User getUserFromCookie(FullHttpRequest request) {
method closeHardwareChannelByDashId (line 89) | public void closeHardwareChannelByDashId(UserKey userKey, int dashId) {
method close (line 94) | public void close() {
method closeAppChannelsByUser (line 104) | public void closeAppChannelsByUser(UserKey userKey) {
FILE: server/core/src/main/java/cc/blynk/server/core/dao/SharedTokenManager.java
class SharedTokenManager (line 16) | public class SharedTokenManager {
method SharedTokenManager (line 24) | SharedTokenManager(Collection<User> users) {
method assignToken (line 35) | public void assignToken(User user, DashBoard dash, String newToken) {
method getUserByToken (line 52) | SharedTokenValue getUserByToken(String token) {
method deleteProject (line 56) | void deleteProject(DashBoard dash) {
FILE: server/core/src/main/java/cc/blynk/server/core/dao/SharedTokenValue.java
class SharedTokenValue (line 10) | public class SharedTokenValue {
method SharedTokenValue (line 16) | SharedTokenValue(User user, int dashId) {
FILE: server/core/src/main/java/cc/blynk/server/core/dao/TemporaryTokenValue.java
class TemporaryTokenValue (line 14) | public final class TemporaryTokenValue extends TokenValue {
method TemporaryTokenValue (line 19) | TemporaryTokenValue(User user, DashBoard dash, Device device) {
method isExpired (line 24) | @Override
method isTemporary (line 29) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/dao/TokenManager.java
class TokenManager (line 17) | public class TokenManager {
method TokenManager (line 24) | public TokenManager(ConcurrentMap<UserKey, User> users, DBManager dbMa...
method deleteDevice (line 32) | public void deleteDevice(Device device) {
method deleteDash (line 40) | public void deleteDash(DashBoard dash) {
method getTokenValueByToken (line 47) | public TokenValue getTokenValueByToken(String token) {
method getUserBySharedToken (line 51) | public SharedTokenValue getUserBySharedToken(String token) {
method assignToken (line 55) | public void assignToken(User user, DashBoard dash, Device device, Stri...
method assignToken (line 64) | public void assignToken(User user, DashBoard dash, Device device, Stri...
method refreshToken (line 68) | public String refreshToken(User user, DashBoard dash, Device device) {
method refreshSharedToken (line 74) | public String refreshSharedToken(User user, DashBoard dash) {
method updateRegularCache (line 80) | public void updateRegularCache(String token, TokenValue tokenValue) {
method updateRegularCache (line 84) | public void updateRegularCache(String token, User user, DashBoard dash...
method updateSharedCache (line 88) | public void updateSharedCache(String token, User user, int dashId) {
method clearTemporaryTokens (line 92) | public boolean clearTemporaryTokens() {
FILE: server/core/src/main/java/cc/blynk/server/core/dao/TokenValue.java
class TokenValue (line 12) | public class TokenValue {
method TokenValue (line 20) | public TokenValue(User user, DashBoard dash, Device device) {
method isTemporary (line 26) | public boolean isTemporary() {
method isExpired (line 30) | public boolean isExpired(long now) {
FILE: server/core/src/main/java/cc/blynk/server/core/dao/UserDao.java
class UserDao (line 32) | public class UserDao {
method UserDao (line 40) | public UserDao(ConcurrentMap<UserKey, User> users, String region, Stri...
method isUserExists (line 48) | public boolean isUserExists(String name, String appName) {
method isSuperAdminExists (line 52) | public boolean isSuperAdminExists() {
method getSuperAdmin (line 57) | public User getSuperAdmin() {
method getByName (line 66) | public User getByName(String name, String appName) {
method contains (line 70) | public boolean contains(String name, String appName) {
method getUsers (line 75) | public Map<UserKey, User> getUsers() {
method searchByUsername (line 79) | public List<User> searchByUsername(String name, String appName) {
method delete (line 88) | public User delete(UserKey userKey) {
method delete (line 92) | public User delete(String name, String appName) {
method add (line 96) | public void add(User user) {
method getBoardsUsage (line 100) | public Map<String, Integer> getBoardsUsage() {
method getFacebookLogin (line 116) | public Map<String, Integer> getFacebookLogin() {
method getWidgetsUsage (line 128) | public Map<String, Integer> getWidgetsUsage() {
method getProjectsPerUser (line 143) | public Map<String, Integer> getProjectsPerUser() {
method getLibraryVersion (line 153) | public Map<String, Integer> getLibraryVersion() {
method getCpuType (line 169) | public Map<String, Integer> getCpuType() {
method getConnectionType (line 185) | public Map<String, Integer> getConnectionType() {
method getHardwareBoards (line 201) | public Map<String, Integer> getHardwareBoards() {
method getFilledSpace (line 217) | public Map<String, Integer> getFilledSpace() {
method getWebHookHosts (line 238) | public Map<String, Integer> getWebHookHosts() {
method createProjectForExportedApp (line 261) | public void createProjectForExportedApp(TimerWorker timerWorker,
method removeDevicesProvisionedFromDeviceTiles (line 322) | private static void removeDevicesProvisionedFromDeviceTiles(DashBoard ...
method getHost (line 332) | private static String getHost(String url) {
method addFacebookUser (line 353) | public User addFacebookUser(String email, String appName) {
method add (line 360) | public User add(String email, String passHash, String appName) {
method add (line 367) | public void add(String email, String passHash, String appName, boolean...
FILE: server/core/src/main/java/cc/blynk/server/core/dao/UserKey.java
class UserKey (line 15) | public final class UserKey {
method UserKey (line 21) | public UserKey(User user) {
method UserKey (line 25) | public UserKey(String email, String appName) {
method equals (line 30) | @Override
method hashCode (line 47) | @Override
method toString (line 54) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/dao/functions/AverageGraphFunction.java
class AverageGraphFunction (line 8) | public class AverageGraphFunction implements GraphFunction {
method AverageGraphFunction (line 13) | public AverageGraphFunction() {
method apply (line 18) | @Override
method getResult (line 24) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/dao/functions/GraphFunction.java
type GraphFunction (line 8) | public interface GraphFunction {
method apply (line 10) | void apply(double value);
method getResult (line 12) | double getResult();
FILE: server/core/src/main/java/cc/blynk/server/core/dao/functions/MaxGraphFunction.java
class MaxGraphFunction (line 8) | public class MaxGraphFunction implements GraphFunction {
method apply (line 12) | @Override
method getResult (line 17) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/dao/functions/MedianGraphFunction.java
class MedianGraphFunction (line 11) | public class MedianGraphFunction implements GraphFunction {
method MedianGraphFunction (line 15) | public MedianGraphFunction() {
method apply (line 19) | @Override
method getResult (line 24) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/dao/functions/MinGraphFunction.java
class MinGraphFunction (line 8) | public class MinGraphFunction implements GraphFunction {
method apply (line 12) | @Override
method getResult (line 17) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/dao/functions/SumGraphFunction.java
class SumGraphFunction (line 8) | public class SumGraphFunction implements GraphFunction {
method SumGraphFunction (line 12) | public SumGraphFunction() {
method apply (line 16) | @Override
method getResult (line 21) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/dao/ota/OTAInfo.java
class OTAInfo (line 10) | public class OTAInfo {
method OTAInfo (line 18) | OTAInfo(String initiatedBy, String pathToFirmware, String build, Strin...
method makeHardwareBody (line 26) | public String makeHardwareBody(String serverHostUrl) {
method makeHardwareBody (line 30) | public static String makeHardwareBody(String serverHostUrl, String pat...
method matches (line 34) | public boolean matches(String dashName) {
method toString (line 38) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/dao/ota/OTAManager.java
class OTAManager (line 32) | public class OTAManager {
method OTAManager (line 41) | public OTAManager(ServerProperties props) {
method initiateHardwareUpdate (line 48) | public void initiateHardwareUpdate(ChannelHandlerContext ctx, UserKey ...
method getOtaInfoForHardware (line 58) | private OTAInfo getOtaInfoForHardware(UserKey userKey, HardwareInfo ne...
method isValidOtaInfo (line 73) | private static boolean isValidOtaInfo(OTAInfo otaInfo, HardwareInfo ha...
method isFirmwareVersionChanged (line 77) | private static boolean isFirmwareVersionChanged(OTAInfo otaInfo, Hardw...
method sendOtaCommand (line 82) | private void sendOtaCommand(ChannelHandlerContext ctx, Device device, ...
method initiate (line 91) | public void initiate(User initiator, UserKey userKey, String projectNa...
method initiateForAll (line 96) | public void initiateForAll(User initiator, String pathToFirmware) {
method getBuildPatternFromString (line 102) | public static String getBuildPatternFromString(Path path) {
method fetchBuildNumber (line 111) | private String fetchBuildNumber(String pathToFirmware) {
method stop (line 116) | public void stop(User user) {
FILE: server/core/src/main/java/cc/blynk/server/core/model/DashBoard.java
class DashBoard (line 52) | public class DashBoard {
method updateWidgets (line 103) | public boolean updateWidgets(int deviceId, short pin, PinType type, St...
method getNameOrEmpty (line 113) | public String getNameOrEmpty() {
method getNameOrDefault (line 117) | public String getNameOrDefault() {
method initStorageValueForStorageKey (line 124) | public PinStorageValue initStorageValueForStorageKey(DashPinStorageKey...
method activate (line 176) | public void activate() {
method deactivate (line 181) | public void deactivate() {
method findWidgetByPin (line 186) | public Widget findWidgetByPin(int deviceId, short pin, PinType pinType) {
method findWebhookByPin (line 195) | public WebHook findWebhookByPin(int deviceId, short pin, PinType pinTy...
method getWidgetIndexByIdOrThrow (line 207) | public static int getWidgetIndexByIdOrThrow(Widget[] widgets, long id) {
method getWidgetIndexByIdOrThrow (line 216) | public int getWidgetIndexByIdOrThrow(long id) {
method hasWidgetsByDeviceId (line 220) | public boolean hasWidgetsByDeviceId(int deviceId) {
method getDeviceSelector (line 229) | public DeviceSelector getDeviceSelector(long targetId) {
method getWidgetByIdOrThrow (line 237) | public Widget getWidgetByIdOrThrow(long id) {
method getWidgetById (line 241) | public Widget getWidgetById(long id) {
method getWidgetByIdInDeviceTilesOrThrow (line 245) | public Widget getWidgetByIdInDeviceTilesOrThrow(long id) {
method getWidgetById (line 258) | public static Widget getWidgetById(Widget[] widgets, long id) {
method getNotificationWidget (line 267) | public Notification getNotificationWidget() {
method getEventorWidget (line 271) | public Eventor getEventorWidget() {
method getTwitterWidget (line 275) | public Twitter getTwitterWidget() {
method getMailWidget (line 279) | public Mail getMailWidget() {
method getReportingWidget (line 283) | public ReportingWidget getReportingWidget() {
method getWidgetByType (line 287) | @SuppressWarnings("unchecked")
method buildPMMessage (line 297) | public String buildPMMessage(int deviceId) {
method energySum (line 309) | public int energySum() {
method eraseWidgetValues (line 321) | public void eraseWidgetValues() {
method eraseWidgetValuesForDevice (line 327) | public void eraseWidgetValuesForDevice(int deviceId) {
method addTimers (line 338) | public void addTimers(TimerWorker timerWorker, UserKey userKey) {
method updateSettings (line 351) | public void updateSettings(DashboardSettings settings) {
method updateFields (line 364) | public void updateFields(DashBoard updatedDashboard) {
method updateFaceFields (line 387) | public void updateFaceFields(DashBoard parent) {
method copyWidgetsAndPreservePrevValues (line 407) | private static Widget[] copyWidgetsAndPreservePrevValues(Widget[] oldW...
method updateProperty (line 430) | public Widget updateProperty(int deviceId, short pin, WidgetProperty w...
method equals (line 442) | @Override
method hashCode (line 463) | @Override
method toString (line 471) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/DashboardSettings.java
class DashboardSettings (line 12) | public final class DashboardSettings {
method DashboardSettings (line 32) | @JsonCreator
FILE: server/core/src/main/java/cc/blynk/server/core/model/DataStream.java
class DataStream (line 15) | public class DataStream {
method DataStream (line 35) | @JsonCreator
method DataStream (line 54) | public DataStream(DataStream dataStream) {
method DataStream (line 60) | public DataStream(short pin, PinType pinType) {
method makeReadingHardwareBody (line 64) | public static String makeReadingHardwareBody(char pinType, short pin) {
method makeHardwareBody (line 68) | public static String makeHardwareBody(char pinType, String pin, String...
method makeHardwareBody (line 72) | public static String makeHardwareBody(PinType pinType, short pin, Stri...
method makeHardwareBody (line 76) | public static String makeHardwareBody(char pinTypeChar, short pin, Str...
method makeHardwareBody (line 80) | public static String makeHardwareBody(boolean pwmMode, PinType pinType...
method makePropertyHardwareBody (line 84) | public static String makePropertyHardwareBody(short pin, WidgetPropert...
method isSame (line 88) | public boolean isSame(short pin, PinType type) {
method makeHardwareBody (line 92) | public String makeHardwareBody() {
method isValid (line 96) | public static boolean isValid(short pin, PinType pinType) {
method isValid (line 100) | public boolean isValid() {
method isNotEmpty (line 104) | public boolean isNotEmpty() {
method notEmptyAndIsValid (line 108) | public boolean notEmptyAndIsValid() {
method equals (line 112) | @Override
method hashCode (line 147) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/Profile.java
class Profile (line 49) | public class Profile {
method getFirstDashOrEmpty (line 62) | public DashBoard getFirstDashOrEmpty() {
method getDeviceName (line 69) | public String getDeviceName(DashBoard dash, int deviceId) {
method getCSVDeviceName (line 77) | public String getCSVDeviceName(DashBoard dash, int deviceId) {
method getDeviceById (line 91) | public Device getDeviceById(DashBoard dash, int id) {
method addDevice (line 100) | public void addDevice(DashBoard dash, Device device) {
method deleteDevice (line 104) | public Device deleteDevice(DashBoard dash, int deviceId) {
method getDeviceIndexByIdOrThrow (line 112) | private int getDeviceIndexByIdOrThrow(DashBoard dash, int id) {
method setOfflineDevice (line 122) | public void setOfflineDevice(DashBoard dash) {
method deleteTag (line 131) | public void deleteTag(DashBoard dash, int tagId) {
method addTag (line 136) | public void addTag(DashBoard dash, Tag newTag) {
method getTagIndexByIdOrThrow (line 140) | private int getTagIndexByIdOrThrow(DashBoard dash, int id) {
method getTagById (line 149) | public Tag getTagById(DashBoard dash, int id) {
method deleteDeviceFromTags (line 158) | public void deleteDeviceFromTags(DashBoard dash, int deviceId) {
method cleanPinStorage (line 164) | public void cleanPinStorage(DashBoard dash, Widget widget, boolean rem...
method cleanPinStorageForTileTemplate (line 169) | public void cleanPinStorageForTileTemplate(DashBoard dash, TileTemplat...
method cleanPinStorage (line 184) | private void cleanPinStorage(DashBoard dash,
method cleanPinStorage (line 196) | private void cleanPinStorage(DashBoard dash, OnePinWidget onePinWidget,
method removePinStorageValue (line 204) | private void removePinStorageValue(DashBoard dash, int targetId,
method sendAppSyncs (line 228) | public void sendAppSyncs(DashBoard dash, Channel appChannel, int targe...
method sendPinStorageSyncs (line 237) | private void sendPinStorageSyncs(DashBoard dash, Channel appChannel, i...
method cleanPinStorage (line 249) | public void cleanPinStorage(DashBoard dash, boolean removeProperties,
method cleanPinStorageInternalWithoutUpdatedAt (line 257) | private void cleanPinStorageInternalWithoutUpdatedAt(DashBoard dash, W...
method cleanPinStorage (line 274) | private void cleanPinStorage(int dashId, DeviceTiles deviceTiles, bool...
method cleanPinStorageForTemplate (line 289) | private void cleanPinStorageForTemplate(DashBoard dash,
method cleanPinStorageForDevice (line 296) | public void cleanPinStorageForDevice(int deviceId) {
method update (line 300) | public void update(DashBoard dash, int deviceId, short pin, PinType pi...
method putPinPropertyStorageValue (line 309) | public void putPinPropertyStorageValue(DashBoard dash, int deviceId, P...
method putPinStorageValue (line 314) | private void putPinStorageValue(DashBoard dash, int deviceId, PinType ...
method putPinStorageValue (line 318) | private void putPinStorageValue(DashBoard dash, DashPinStorageKey key,...
method getWidgetWithLoggedPin (line 327) | public Widget getWidgetWithLoggedPin(DashBoard dash, int deviceId, sho...
method isWithinGraph (line 358) | private boolean isWithinGraph(DashBoard dash, Superchart graph,
method getDashIndexOrThrow (line 394) | public int getDashIndexOrThrow(int dashId) {
method getDashByIdOrThrow (line 403) | public DashBoard getDashByIdOrThrow(int id) {
method getDashById (line 412) | public DashBoard getDashById(int id) {
method getAppIndexById (line 421) | public int getAppIndexById(String id) {
method getAppById (line 430) | public App getAppById(String id) {
method toString (line 439) | @Override
method equals (line 444) | @Override
method hashCode (line 458) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/auth/App.java
class App (line 14) | public class App {
method App (line 32) | @JsonCreator
method update (line 51) | public void update(App newApp) {
method isNotValid (line 61) | public boolean isNotValid() {
method toString (line 66) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/auth/FacebookTokenResponse.java
class FacebookTokenResponse (line 11) | public class FacebookTokenResponse {
method FacebookTokenResponse (line 15) | @JsonCreator
FILE: server/core/src/main/java/cc/blynk/server/core/model/auth/Session.java
class Session (line 34) | public class Session {
method Session (line 45) | public Session(EventLoop initialEventLoop) {
method isSameEventLoop (line 49) | public boolean isSameEventLoop(ChannelHandlerContext ctx) {
method isSameEventLoop (line 53) | public boolean isSameEventLoop(Channel channel) {
method getRequestRate (line 57) | private static int getRequestRate(Set<Channel> channels) {
method needSync (line 73) | public static boolean needSync(Channel channel, String sharedToken) {
method addAppChannel (line 78) | public void addAppChannel(Channel appChannel) {
method addHardChannel (line 84) | public void addHardChannel(Channel hardChannel) {
method filter (line 90) | private Set<Channel> filter(int bodySize, int activeDashId, int[] devi...
method filter (line 106) | private Set<Channel> filter(int bodySize, int activeDashId, int device...
method sendMessageToHardware (line 121) | public boolean sendMessageToHardware(int activeDashId, short cmd, int ...
method sendMessageToHardware (line 126) | public boolean sendMessageToHardware(int activeDashId, short cmd, int ...
method sendMessageToHardware (line 131) | public boolean sendMessageToHardware(short cmd, int msgId, String body) {
method sendMessageToHardware (line 135) | private boolean sendMessageToHardware(Set<Channel> targetChannels, sho...
method isHardwareConnected (line 146) | public boolean isHardwareConnected() {
method isHardwareConnected (line 150) | public boolean isHardwareConnected(int dashId, int deviceId) {
method isHardwareConnected (line 159) | public boolean isHardwareConnected(int dashId) {
method sendOfflineMessageToApps (line 168) | public void sendOfflineMessageToApps(int dashId, int deviceId) {
method sendToApps (line 178) | public void sendToApps(short cmd, int msgId, int dashId, int deviceId,...
method sendToApps (line 185) | public void sendToApps(short cmd, int msgId, int dashId, String finalB...
method filterByDash (line 194) | private Set<Channel> filterByDash(int dashId) {
method sendMessageToMultipleReceivers (line 204) | private static void sendMessageToMultipleReceivers(Set<Channel> target...
method send (line 212) | private static void send(Set<Channel> targets, short cmd, int msgId, S...
method sendToSharedApps (line 217) | public void sendToSharedApps(Channel sendingChannel, String sharedToke...
method isAppConnected (line 231) | public boolean isAppConnected() {
method getAppRequestRate (line 235) | public int getAppRequestRate() {
method getHardRequestRate (line 239) | public int getHardRequestRate() {
method closeHardwareChannelByDeviceId (line 243) | public void closeHardwareChannelByDeviceId(int dashId, int deviceId) {
method closeHardwareChannelByDashId (line 251) | public void closeHardwareChannelByDashId(int dashId) {
method closeAll (line 259) | public void closeAll() {
FILE: server/core/src/main/java/cc/blynk/server/core/model/auth/User.java
class User (line 15) | public class User {
method User (line 47) | public User() {
method User (line 55) | public User(String email, String passHash, String appName, String regi...
method User (line 69) | public User(String email, String passHash, String appName, String regi...
method id (line 89) | @JsonProperty("id")
method notEnoughEnergy (line 94) | public boolean notEnoughEnergy(int price) {
method subtractEnergy (line 98) | @SuppressWarnings("NonAtomicOperationOnVolatileField")
method addEnergy (line 104) | @SuppressWarnings("NonAtomicOperationOnVolatileField")
method checkDailyEmailLimit (line 114) | public void checkDailyEmailLimit() {
method isUpdated (line 126) | public boolean isUpdated(long lastStart) {
method resetPass (line 130) | public void resetPass(String hash) {
method isDashUpdated (line 135) | private boolean isDashUpdated(long lastStart) {
method equals (line 144) | @Override
method hashCode (line 162) | @Override
method toString (line 169) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/device/BoardType.java
type BoardType (line 13) | public enum BoardType {
method BoardType (line 89) | BoardType(String label) {
method fromLabel (line 93) | @JsonCreator
method label (line 103) | @JsonValue
FILE: server/core/src/main/java/cc/blynk/server/core/model/device/ConnectionType.java
type ConnectionType (line 8) | public enum ConnectionType {
FILE: server/core/src/main/java/cc/blynk/server/core/model/device/Device.java
class Device (line 15) | public class Device implements Target {
method Device (line 61) | public Device(int id, String name, BoardType boardType) {
method Device (line 67) | public Device() {
method isNotValid (line 70) | public boolean isNotValid() {
method getDeviceIds (line 74) | @Override
method isSelected (line 79) | @Override
method getAssignedDeviceIds (line 84) | @Override
method contains (line 89) | @Override
method getDeviceId (line 94) | @Override
method update (line 99) | public void update(Device newDevice) {
method disconnected (line 112) | public void disconnected() {
method connected (line 117) | public void connected() {
method erase (line 122) | public void erase() {
method getNameOrDefault (line 134) | public String getNameOrDefault() {
method updateOTAInfo (line 139) | public void updateOTAInfo(String initiatedBy) {
method fitsBufferSize (line 144) | public boolean fitsBufferSize(int bodySize) {
method toString (line 151) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/device/DeviceOtaInfo.java
class DeviceOtaInfo (line 11) | public class DeviceOtaInfo {
method DeviceOtaInfo (line 19) | @JsonCreator
FILE: server/core/src/main/java/cc/blynk/server/core/model/device/DeviceStatusDTO.java
class DeviceStatusDTO (line 8) | public class DeviceStatusDTO {
method DeviceStatusDTO (line 36) | public DeviceStatusDTO(Device device) {
method transform (line 52) | public static DeviceStatusDTO[] transform(Device[] devices) {
FILE: server/core/src/main/java/cc/blynk/server/core/model/device/HardwareInfo.java
class HardwareInfo (line 16) | public class HardwareInfo {
method HardwareInfo (line 38) | @JsonCreator
method HardwareInfo (line 59) | public HardwareInfo(String[] info) {
FILE: server/core/src/main/java/cc/blynk/server/core/model/device/HardwareInfoPrivate.java
class HardwareInfoPrivate (line 4) | public final class HardwareInfoPrivate {
method HardwareInfoPrivate (line 16) | public HardwareInfoPrivate(String[] info) {
method intiField (line 24) | private void intiField(final String key, final String value) {
FILE: server/core/src/main/java/cc/blynk/server/core/model/device/Status.java
type Status (line 8) | public enum Status {
FILE: server/core/src/main/java/cc/blynk/server/core/model/device/Tag.java
class Tag (line 17) | public class Tag implements Target, DeviceCleaner {
method isNotValid (line 28) | public boolean isNotValid() {
method Tag (line 33) | public Tag(int id, String name) {
method Tag (line 39) | @JsonCreator
method getDeviceIds (line 48) | @Override
method isSelected (line 53) | @Override
method getAssignedDeviceIds (line 58) | @Override
method contains (line 63) | @Override
method getDeviceId (line 68) | @Override
method isTag (line 73) | @Override
method update (line 78) | public void update(Tag tag) {
method copy (line 83) | public Tag copy() {
method deleteDevice (line 87) | @Override
method toString (line 92) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/enums/PinMode.java
type PinMode (line 12) | public enum PinMode {
FILE: server/core/src/main/java/cc/blynk/server/core/model/enums/PinType.java
type PinType (line 8) | public enum PinType {
method PinType (line 17) | PinType(char pinType) {
method getPinType (line 22) | public static PinType getPinType(char pinTypeChar) {
FILE: server/core/src/main/java/cc/blynk/server/core/model/enums/ProvisionType.java
type ProvisionType (line 8) | public enum ProvisionType {
FILE: server/core/src/main/java/cc/blynk/server/core/model/enums/Theme.java
type Theme (line 8) | public enum Theme {
FILE: server/core/src/main/java/cc/blynk/server/core/model/enums/WidgetProperty.java
type WidgetProperty (line 8) | public enum WidgetProperty {
method WidgetProperty (line 36) | WidgetProperty(String label) {
method getProperty (line 40) | public static WidgetProperty getProperty(String value) {
method toString (line 89) | @Override
method getValues (line 94) | public static WidgetProperty[] getValues() {
FILE: server/core/src/main/java/cc/blynk/server/core/model/graph/GraphKey.java
class GraphKey (line 11) | public class GraphKey {
method GraphKey (line 23) | public GraphKey(int dashId, String[] bodyParts, long ts) {
method equals (line 31) | @Override
method hashCode (line 51) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/serialization/CopyUtil.java
class CopyUtil (line 18) | public final class CopyUtil {
method CopyUtil (line 22) | private CopyUtil() {
method copyTags (line 25) | public static Tag[] copyTags(Tag[] tagsToCopy) {
method deepCopy (line 36) | public static DashBoard deepCopy(DashBoard dash) {
method deepCopy (line 51) | public static Profile deepCopy(Profile profile) {
FILE: server/core/src/main/java/cc/blynk/server/core/model/serialization/JsonParser.java
class JsonParser (line 45) | public final class JsonParser {
method JsonParser (line 49) | private JsonParser() {
method init (line 88) | public static ObjectMapper init() {
method toJson (line 97) | public static String toJson(User user) {
method toJson (line 101) | public static String toJson(Profile profile) {
method toJson (line 105) | public static String toJson(DashBoard dashBoard) {
method gzipDash (line 109) | public static byte[] gzipDash(DashBoard dash) {
method gzipDashRestrictive (line 113) | public static byte[] gzipDashRestrictive(DashBoard dash) {
method gzipProfileRestrictive (line 117) | public static byte[] gzipProfileRestrictive(Profile profile) {
method gzipProfile (line 121) | public static byte[] gzipProfile(Profile profile) {
method writeJsonAsCompressedBytes (line 125) | private static byte[] writeJsonAsCompressedBytes(ObjectWriter objectWr...
method toJsonRestrictiveDashboard (line 136) | public static String toJsonRestrictiveDashboard(DashBoard dashBoard) {
method toJsonRestrictiveDashboardForHTTP (line 140) | public static String toJsonRestrictiveDashboardForHTTP(DashBoard dashB...
method toJson (line 144) | public static String toJson(Device device) {
method toJson (line 148) | public static String toJson(App app) {
method toJson (line 152) | public static String toJson(Report report) {
method toJson (line 156) | public static String toJson(Stat stat) {
method writeUser (line 160) | public static void writeUser(File file, User user) throws IOException {
method toJson (line 164) | private static String toJson(ObjectWriter writer, Object o) {
method toJson (line 173) | public static String toJson(Widget widget) {
method toJson (line 182) | public static String toJson(Object o) {
method readAny (line 191) | public static <T> T readAny(String val, Class<T> c) {
method parseUserFromFile (line 200) | public static User parseUserFromFile(Path path) throws IOException {
method parseUserFromFile (line 206) | public static User parseUserFromFile(File userFile) throws IOException {
method parseUserFromString (line 210) | public static User parseUserFromString(String userString) throws IOExc...
method parseProfileFromString (line 214) | public static Profile parseProfileFromString(String profileString) thr...
method parseFacebookTokenResponse (line 218) | public static FacebookTokenResponse parseFacebookTokenResponse(String ...
method parseDashboardSettings (line 222) | public static DashboardSettings parseDashboardSettings(String json, in...
method parseDashboard (line 226) | public static DashBoard parseDashboard(String json, int msgId) {
method parseTileTemplate (line 230) | public static TileTemplate parseTileTemplate(String json, int msgId) {
method parseWidget (line 234) | public static Widget parseWidget(String reader) throws IOException {
method parseReport (line 238) | public static Report parseReport(String json, int msgId) {
method parseWidget (line 242) | public static Widget parseWidget(String json, int msgId) {
method parseApp (line 246) | public static App parseApp(String json, int msgId) {
method parseDevice (line 250) | public static Device parseDevice(String json, int msgId) {
method parseTag (line 254) | public static Tag parseTag(String json, int msgId) {
method parse (line 258) | private static <T> T parse(ObjectReader objectReader, String json, Str...
method valueToJsonAsString (line 267) | public static String valueToJsonAsString(Collection<String> values) {
method valueToJsonAsString (line 275) | public static String valueToJsonAsString(SinglePinStorageValue singleP...
method valueToJsonAsString (line 284) | private static String valueToJsonAsString(String[] values) {
method valueToJsonAsString (line 292) | public static String valueToJsonAsString(String value) {
method makeJsonStringValue (line 296) | private static String makeJsonStringValue(String value) {
FILE: server/core/src/main/java/cc/blynk/server/core/model/serialization/View.java
class View (line 3) | public class View {
class PublicOnly (line 9) | public static class PublicOnly {
class Private (line 16) | public static class Private {
class HttpAPIField (line 19) | public static class HttpAPIField {
FILE: server/core/src/main/java/cc/blynk/server/core/model/storage/DashPinStorageKeyDeserializer.java
class DashPinStorageKeyDeserializer (line 17) | public class DashPinStorageKeyDeserializer extends KeyDeserializer {
method deserializeKey (line 19) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/storage/PinStorageKeyDeserializer.java
class PinStorageKeyDeserializer (line 17) | @Deprecated
method deserializeKey (line 20) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/storage/PinStorageValueDeserializer.java
class PinStorageValueDeserializer (line 22) | public class PinStorageValueDeserializer extends JsonDeserializer {
method deserialize (line 26) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/storage/key/DashPinPropertyStorageKey.java
class DashPinPropertyStorageKey (line 15) | public final class DashPinPropertyStorageKey extends DashPinStorageKey {
method DashPinPropertyStorageKey (line 19) | private DashPinPropertyStorageKey(int dashId, int deviceId, char pinTy...
method DashPinPropertyStorageKey (line 24) | public DashPinPropertyStorageKey(int dashId, int deviceId, PinType pin...
method DashPinPropertyStorageKey (line 29) | public DashPinPropertyStorageKey(int dashId, PinPropertyStorageKey pin...
method makeHardwareBody (line 36) | @Override
method getCmdType (line 41) | @Override
method equals (line 46) | @Override
method hashCode (line 63) | @Override
method toString (line 70) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/storage/key/DashPinStorageKey.java
class DashPinStorageKey (line 17) | public class DashPinStorageKey {
method DashPinStorageKey (line 27) | public DashPinStorageKey(int dashId, int deviceId, char pintTypeChar, ...
method DashPinStorageKey (line 34) | public DashPinStorageKey(int dashId, int deviceId, PinType pinType, sh...
method DashPinStorageKey (line 38) | public DashPinStorageKey(int dashId, PinStorageKey pinStorageKey) {
method isSame (line 42) | public boolean isSame(int dashId, OnePinWidget onePinWidget) {
method isSame (line 48) | public boolean isSame(int dashId, MultiPinWidget multiPinWidget) {
method makeHardwareBody (line 60) | public String makeHardwareBody(String value) {
method getCmdType (line 64) | public short getCmdType() {
method equals (line 68) | @Override
method hashCode (line 91) | @Override
method toString (line 100) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/storage/key/PinPropertyStorageKey.java
class PinPropertyStorageKey (line 15) | @Deprecated
method PinPropertyStorageKey (line 20) | public PinPropertyStorageKey(int deviceId, PinType pinType, short pin,...
method makeHardwareBody (line 25) | @Override
method getCmdType (line 30) | @Override
method equals (line 35) | @Override
method hashCode (line 52) | @Override
method toString (line 59) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/storage/key/PinStorageKey.java
class PinStorageKey (line 17) | @Deprecated
method PinStorageKey (line 26) | public PinStorageKey(int deviceId, PinType pinType, short pin) {
method isSamePin (line 32) | public boolean isSamePin(OnePinWidget onePinWidget) {
method isSamePin (line 36) | public boolean isSamePin(MultiPinWidget multiPinWidget) {
method makeHardwareBody (line 48) | public String makeHardwareBody(String value) {
method getCmdType (line 52) | public short getCmdType() {
method equals (line 56) | @Override
method hashCode (line 76) | @Override
method toString (line 84) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/storage/value/MultiPinStorageValue.java
class MultiPinStorageValue (line 23) | public class MultiPinStorageValue extends PinStorageValue {
method MultiPinStorageValue (line 29) | public MultiPinStorageValue(MultiPinStorageValueType multiPinStorageVa...
method sendAppSync (line 34) | @Override
method values (line 58) | @Override
method update (line 63) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/storage/value/MultiPinStorageValueType.java
type MultiPinStorageValueType (line 14) | public enum MultiPinStorageValueType {
method getQueue (line 21) | public BaseLimitedQueue<String> getQueue() {
FILE: server/core/src/main/java/cc/blynk/server/core/model/storage/value/PinStorageValue.java
class PinStorageValue (line 14) | public abstract class PinStorageValue {
method update (line 16) | public abstract void update(String value);
method values (line 18) | public abstract Collection<String> values();
method sendAppSync (line 20) | public abstract void sendAppSync(Channel appChannel, int dashId, DashP...
FILE: server/core/src/main/java/cc/blynk/server/core/model/storage/value/SinglePinStorageValue.java
class SinglePinStorageValue (line 21) | public class SinglePinStorageValue extends PinStorageValue {
method SinglePinStorageValue (line 25) | public SinglePinStorageValue() {
method SinglePinStorageValue (line 28) | public SinglePinStorageValue(String value) {
method update (line 32) | @Override
method values (line 37) | @Override
method sendAppSync (line 45) | @Override
method toString (line 57) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/CopyObject.java
type CopyObject (line 8) | public interface CopyObject<T> {
method copy (line 10) | T copy();
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/DeviceCleaner.java
type DeviceCleaner (line 3) | public interface DeviceCleaner {
method deleteDevice (line 5) | void deleteDevice(int deviceId);
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/FrequencyWidget.java
type FrequencyWidget (line 10) | public interface FrequencyWidget {
method writeReadingCommand (line 14) | void writeReadingCommand(Channel channel);
method getDeviceId (line 16) | int getDeviceId();
method isTicked (line 18) | boolean isTicked(long now);
method hasReadingInterval (line 20) | boolean hasReadingInterval();
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/HardwareSyncWidget.java
type HardwareSyncWidget (line 13) | public interface HardwareSyncWidget {
method sendHardSync (line 15) | void sendHardSync(ChannelHandlerContext ctx, int msgId, int deviceId);
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/MobileSyncWidget.java
type MobileSyncWidget (line 14) | public interface MobileSyncWidget {
method sendAppSync (line 20) | void sendAppSync(Channel appChannel, int dashId, int targetId);
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/MultiPinWidget.java
class MultiPinWidget (line 18) | public abstract class MultiPinWidget extends Widget implements MobileSyn...
method updateIfSame (line 25) | @Override
method isSame (line 39) | @Override
method isSplitMode (line 51) | public abstract boolean isSplitMode();
method isAssignedToDeviceSelector (line 53) | public boolean isAssignedToDeviceSelector() {
method makeHardwareBody (line 57) | public String makeHardwareBody(short pinIn, PinType pinType) {
method append (line 81) | @Override
method getJsonValue (line 90) | @Override
method updateValue (line 115) | @Override
method erase (line 128) | @Override
method isAssignedToDevice (line 139) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/NoPinWidget.java
class NoPinWidget (line 12) | public abstract class NoPinWidget extends Widget {
method getModeType (line 14) | @Override
method erase (line 19) | @Override
method updateValue (line 23) | @Override
method isAssignedToDevice (line 27) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/OnePinReadingWidget.java
class OnePinReadingWidget (line 15) | public abstract class OnePinReadingWidget extends OnePinWidget implement...
method isTicked (line 21) | @Override
method hasReadingInterval (line 30) | @Override
method getDeviceId (line 35) | @Override
method writeReadingCommand (line 40) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/OnePinWidget.java
class OnePinWidget (line 26) | public abstract class OnePinWidget extends Widget implements MobileSyncW...
method makeMultiValueHardwareBody (line 44) | public static String makeMultiValueHardwareBody(int dashId, int deviceId,
method makeHardwareBody (line 56) | public static String makeHardwareBody(PinType pinType, short pin, Stri...
method makeHardwareBody (line 60) | public static String makeHardwareBody(char pintTypeChar, short pin, St...
method sendAppSync (line 64) | @Override
method isAssignedToDeviceSelector (line 80) | public boolean isAssignedToDeviceSelector() {
method isValid (line 84) | public boolean isValid() {
method isNotValid (line 88) | public boolean isNotValid() {
method makeHardwareBody (line 92) | public String makeHardwareBody() {
method updateIfSame (line 99) | @Override
method sendHardSync (line 108) | @Override
method isSame (line 118) | @Override
method getJsonValue (line 127) | @Override
method append (line 135) | @Override
method setProperty (line 142) | @Override
method updateValue (line 158) | @Override
method erase (line 169) | @Override
method isAssignedToDevice (line 174) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/Target.java
type Target (line 8) | public interface Target {
method getDeviceIds (line 11) | int[] getDeviceIds();
method isSelected (line 13) | boolean isSelected(int deviceId);
method getAssignedDeviceIds (line 15) | int[] getAssignedDeviceIds();
method getDeviceId (line 17) | int getDeviceId();
method contains (line 19) | boolean contains(int deviceId);
method isTag (line 21) | default boolean isTag() {
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/Widget.java
class Widget (line 78) | @JsonTypeInfo(
method getModeType (line 173) | public abstract PinMode getModeType();
method getPrice (line 175) | public abstract int getPrice();
method updateValue (line 177) | public abstract void updateValue(Widget oldWidget);
method erase (line 179) | public abstract void erase();
method isAssignedToDevice (line 185) | public abstract boolean isAssignedToDevice(int deviceId);
method append (line 187) | protected void append(StringBuilder sb, short pin, PinType pinType) {
method updateIfSame (line 199) | public boolean updateIfSame(int deviceId, short pin, PinType type, Str...
method isSame (line 203) | public boolean isSame(int deviceId, short pin, PinType type) {
method getJsonValue (line 207) | public String getJsonValue() {
method append (line 214) | public void append(StringBuilder sb, int deviceId) {
method copy (line 218) | @Override
method getPinStorageValue (line 228) | public PinStorageValue getPinStorageValue() {
method isMultiValueWidget (line 232) | public boolean isMultiValueWidget() {
method setProperty (line 236) | public boolean setProperty(WidgetProperty property, String propertyVal...
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/controls/Button.java
class Button (line 13) | public class Button extends OnePinWidget {
method makeHardwareBody (line 23) | @Override
method getModeType (line 31) | @Override
method getPrice (line 36) | @Override
method setProperty (line 41) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/controls/ButtonState.java
class ButtonState (line 11) | public class ButtonState {
method ButtonState (line 21) | @JsonCreator
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/controls/ButtonStyle.java
type ButtonStyle (line 3) | public enum ButtonStyle {
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/controls/Edge.java
type Edge (line 3) | public enum Edge {
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/controls/LinkButton.java
class LinkButton (line 11) | public class LinkButton extends NoPinWidget {
method getPrice (line 33) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/controls/NumberInput.java
class NumberInput (line 13) | public class NumberInput extends OnePinWidget {
method setProperty (line 23) | @Override
method getModeType (line 34) | @Override
method getPrice (line 39) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/controls/QR.java
class QR (line 11) | public class QR extends OnePinWidget {
method getModeType (line 13) | @Override
method getPrice (line 18) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/controls/RGB.java
class RGB (line 20) | public class RGB extends MultiPinWidget implements HardwareSyncWidget {
method sendHardSync (line 28) | @Override
method sendAppSync (line 48) | @Override
method isSplitMode (line 72) | public boolean isSplitMode() {
method getModeType (line 76) | @Override
method getPrice (line 81) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/controls/SegmentedControl.java
class SegmentedControl (line 14) | public class SegmentedControl extends OnePinWidget {
method getModeType (line 20) | @Override
method getPrice (line 25) | @Override
method setProperty (line 30) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/controls/Slider.java
class Slider (line 12) | public class Slider extends OnePinWidget {
method getModeType (line 22) | @Override
method getPrice (line 27) | @Override
method setProperty (line 32) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/controls/Step.java
class Step (line 12) | public class Step extends OnePinWidget {
method getModeType (line 26) | @Override
method getPrice (line 31) | @Override
method setProperty (line 36) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/controls/StyledButton.java
class StyledButton (line 14) | public class StyledButton extends OnePinWidget {
method makeHardwareBody (line 30) | @Override
method getModeType (line 38) | @Override
method getPrice (line 43) | @Override
method setProperty (line 48) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/controls/Switch.java
class Switch (line 13) | public class Switch extends OnePinWidget {
method makeHardwareBody (line 27) | @Override
method getModeType (line 35) | @Override
method getPrice (line 40) | @Override
method setProperty (line 45) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/controls/Terminal.java
class Terminal (line 24) | public class Terminal extends OnePinWidget {
method updateIfSame (line 38) | @Override
method sendAppSync (line 51) | @Override
method makeHardwareBody (line 65) | @Override
method getPinStorageValue (line 74) | @Override
method isMultiValueWidget (line 79) | @Override
method getJsonValue (line 84) | @Override
method getModeType (line 89) | @Override
method getPrice (line 95) | @Override
method erase (line 100) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/controls/TextInput.java
class TextInput (line 12) | public class TextInput extends OnePinWidget {
method getModeType (line 20) | @Override
method getPrice (line 25) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/controls/Timer.java
class Timer (line 13) | public class Timer extends OnePinWidget {
method isValidStart (line 25) | public boolean isValidStart() {
method isValidStop (line 29) | public boolean isValidStop() {
method isValidTime (line 33) | public static boolean isValidTime(int time) {
method isValidValue (line 37) | private static boolean isValidValue(String value) {
method getModeType (line 41) | @Override
method getPrice (line 46) | @Override
method erase (line 51) | @Override
method updateValue (line 60) | @Override
method equals (line 78) | @Override
method hashCode (line 93) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/controls/TwoAxisJoystick.java
class TwoAxisJoystick (line 20) | public class TwoAxisJoystick extends MultiPinWidget implements HardwareS...
method sendHardSync (line 30) | @Override
method sendAppSync (line 50) | @Override
method isSplitMode (line 74) | public boolean isSplitMode() {
method getModeType (line 78) | @Override
method getPrice (line 84) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/controls/VerticalSlider.java
class VerticalSlider (line 8) | public class VerticalSlider extends Slider {
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/controls/VerticalStep.java
class VerticalStep (line 8) | public class VerticalStep extends Step {
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/notifications/Mail.java
class Mail (line 12) | public class Mail extends NoPinWidget {
method updateValue (line 18) | @Override
method erase (line 27) | @Override
method getPrice (line 32) | @Override
method isText (line 37) | public boolean isText() {
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/notifications/Notification.java
class Notification (line 19) | public class Notification extends NoPinWidget {
method isWrongBody (line 37) | public static boolean isWrongBody(String body) {
method hasNoToken (line 41) | public boolean hasNoToken() {
method getPrice (line 45) | @Override
method push (line 50) | public void push(GCMWrapper gcmWrapper, String body, int dashId) {
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/notifications/SMS.java
class SMS (line 10) | public class SMS extends NoPinWidget {
method getPrice (line 14) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/notifications/Twitter.java
class Twitter (line 12) | public class Twitter extends NoPinWidget {
method isWrongBody (line 25) | public static boolean isWrongBody(String body) {
method getPrice (line 29) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/others/Bluetooth.java
class Bluetooth (line 10) | public class Bluetooth extends NoPinWidget {
method getPrice (line 16) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/others/BluetoothSerial.java
class BluetoothSerial (line 10) | public class BluetoothSerial extends NoPinWidget {
method getPrice (line 16) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/others/Bridge.java
class Bridge (line 10) | public class Bridge extends NoPinWidget {
method getPrice (line 12) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/others/Player.java
class Player (line 13) | public class Player extends OnePinWidget {
method updateIfSame (line 17) | @Override
method getModeType (line 34) | @Override
method getPrice (line 39) | @Override
method setProperty (line 44) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/others/TextWidget.java
class TextWidget (line 12) | public class TextWidget extends NoPinWidget {
method getPrice (line 20) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/others/Video.java
class Video (line 14) | public class Video extends OnePinWidget {
method sendAppSync (line 20) | @Override
method sendHardSync (line 24) | @Override
method setProperty (line 28) | @Override
method getModeType (line 39) | @Override
method getPrice (line 45) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/others/eventor/Eventor.java
class Eventor (line 13) | public class Eventor extends NoPinWidget {
method Eventor (line 19) | public Eventor() {
method Eventor (line 24) | public Eventor(Rule[] rules) {
method getModeType (line 29) | @Override
method append (line 34) | @Override
method getPrice (line 53) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/others/eventor/Rule.java
class Rule (line 16) | public class Rule {
method Rule (line 31) | @JsonCreator
method notEmpty (line 44) | private boolean notEmpty() {
method isReady (line 48) | public boolean isReady(short pin, PinType pinType) {
method isValidTimerRule (line 52) | public boolean isValidTimerRule() {
method matchesCondition (line 57) | public boolean matchesCondition(String inValue, double parsedInValueTo...
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/others/eventor/TimerTime.java
class TimerTime (line 23) | public class TimerTime {
method TimerTime (line 37) | @JsonCreator
method TimerTime (line 48) | public TimerTime(int time) {
method isTickTime (line 52) | public boolean isTickTime(ZonedDateTime currentDateTime) {
method equals (line 58) | @Override
method hashCode (line 82) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/others/eventor/model/action/BaseAction.java
class BaseAction (line 14) | @JsonTypeInfo(
method isValid (line 26) | public abstract boolean isValid();
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/others/eventor/model/action/SetPinAction.java
class SetPinAction (line 13) | public class SetPinAction extends BaseAction {
method SetPinAction (line 22) | @JsonCreator
method SetPinAction (line 31) | public SetPinAction(short pin, PinType pinType, String value) {
method makeHardwareBody (line 37) | public String makeHardwareBody() {
method isValid (line 41) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/others/eventor/model/action/SetPinActionType.java
type SetPinActionType (line 8) | public enum SetPinActionType {
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/others/eventor/model/action/SetPropertyPinAction.java
class SetPropertyPinAction (line 13) | public class SetPropertyPinAction extends BaseAction {
method SetPropertyPinAction (line 22) | @JsonCreator
method makeHardwareBody (line 31) | public String makeHardwareBody() {
method isValid (line 35) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/others/eventor/model/action/notification/MailAction.java
class MailAction (line 11) | public class MailAction extends NotificationAction {
method MailAction (line 15) | @JsonCreator
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/others/eventor/model/action/notification/NotificationAction.java
class NotificationAction (line 10) | public abstract class NotificationAction extends BaseAction {
method NotificationAction (line 14) | NotificationAction(String message) {
method isValid (line 18) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/others/eventor/model/action/notification/NotifyAction.java
class NotifyAction (line 11) | public class NotifyAction extends NotificationAction {
method NotifyAction (line 13) | @JsonCreator
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/others/eventor/model/action/notification/TwitAction.java
class TwitAction (line 11) | public class TwitAction extends NotificationAction {
method TwitAction (line 13) | @JsonCreator
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/others/eventor/model/condition/BaseCondition.java
class BaseCondition (line 21) | @JsonTypeInfo(
method matches (line 40) | public abstract boolean matches(String inString, double in);
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/others/eventor/model/condition/ValueChanged.java
class ValueChanged (line 11) | public class ValueChanged extends BaseCondition {
method ValueChanged (line 15) | @JsonCreator
method matches (line 20) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/others/eventor/model/condition/number/Between.java
class Between (line 12) | public class Between extends BaseCondition {
method Between (line 18) | @JsonCreator
method matches (line 25) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/others/eventor/model/condition/number/Equal.java
class Equal (line 12) | public class Equal extends BaseCondition {
method Equal (line 16) | @JsonCreator
method matches (line 21) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/others/eventor/model/condition/number/GreaterThan.java
class GreaterThan (line 12) | public class GreaterThan extends BaseCondition {
method GreaterThan (line 16) | @JsonCreator
method matches (line 21) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/others/eventor/model/condition/number/GreaterThanOrEqual.java
class GreaterThanOrEqual (line 12) | public class GreaterThanOrEqual extends BaseCondition {
method GreaterThanOrEqual (line 16) | @JsonCreator
method matches (line 21) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/others/eventor/model/condition/number/LessThan.java
class LessThan (line 12) | public class LessThan extends BaseCondition {
method LessThan (line 16) | @JsonCreator
method matches (line 21) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/others/eventor/model/condition/number/LessThanOrEqual.java
class LessThanOrEqual (line 12) | public class LessThanOrEqual extends BaseCondition {
method LessThanOrEqual (line 16) | @JsonCreator
method matches (line 21) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/others/eventor/model/condition/number/NotBetween.java
class NotBetween (line 12) | public class NotBetween extends BaseCondition {
method NotBetween (line 18) | @JsonCreator
method matches (line 25) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/others/eventor/model/condition/number/NotEqual.java
class NotEqual (line 12) | public class NotEqual extends BaseCondition {
method NotEqual (line 16) | @JsonCreator
method matches (line 21) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/others/eventor/model/condition/string/StringEqual.java
class StringEqual (line 12) | public class StringEqual extends BaseCondition {
method StringEqual (line 16) | @JsonCreator
method matches (line 21) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/others/eventor/model/condition/string/StringNotEqual.java
class StringNotEqual (line 12) | public class StringNotEqual extends BaseCondition {
method StringNotEqual (line 16) | @JsonCreator
method matches (line 21) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/others/rtc/RTC.java
class RTC (line 19) | public class RTC extends NoPinWidget {
method getModeType (line 25) | @Override
method getPrice (line 31) | @Override
method updateValue (line 36) | @Override
method getTime (line 43) | public long getTime() {
method getJsonValue (line 55) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/others/rtc/StringToZoneId.java
class StringToZoneId (line 16) | public class StringToZoneId extends JsonDeserializer<ZoneId> {
method parseZoneId (line 18) | public static ZoneId parseZoneId(String zoneString) {
method deserialize (line 33) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/others/rtc/ZoneIdToString.java
class ZoneIdToString (line 14) | public class ZoneIdToString extends JsonSerializer<Object> {
method serialize (line 16) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/others/webhook/Header.java
class Header (line 11) | public class Header {
method Header (line 17) | @JsonCreator
method isValid (line 24) | public boolean isValid() {
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/others/webhook/SupportedWebhookMethod.java
type SupportedWebhookMethod (line 8) | public enum SupportedWebhookMethod {
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/others/webhook/WebHook.java
class WebHook (line 14) | public class WebHook extends OnePinWidget {
method isValidUrl (line 27) | public static boolean isValidUrl(String url) {
method isNotFailed (line 31) | public boolean isNotFailed(int webhookFailureLimit) {
method isSameWebHook (line 36) | public boolean isSameWebHook(int deviceId, short pin, PinType type) {
method sendAppSync (line 40) | @Override
method sendHardSync (line 44) | @Override
method updateIfSame (line 48) | @Override
method isSame (line 53) | @Override
method getModeType (line 58) | @Override
method getPrice (line 64) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/outputs/Gauge.java
class Gauge (line 13) | public class Gauge extends OnePinReadingWidget {
method getModeType (line 19) | @Override
method setProperty (line 24) | @Override
method getPrice (line 35) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/outputs/LCD.java
class LCD (line 26) | public class LCD extends MultiPinWidget implements FrequencyWidget {
method sendSyncOnActivate (line 42) | private static void sendSyncOnActivate(DataStream dataStream, int dash...
method updateIfSame (line 50) | @Override
method sendAppSync (line 67) | @Override
method isSplitMode (line 93) | @Override
method isTicked (line 98) | @Override
method hasReadingInterval (line 107) | @Override
method writeReadingCommand (line 112) | @Override
method getPinStorageValue (line 126) | @Override
method isMultiValueWidget (line 131) | @Override
method getDeviceId (line 136) | @Override
method getModeType (line 141) | @Override
method getPrice (line 146) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/outputs/LED.java
class LED (line 11) | public class LED extends OnePinWidget {
method getModeType (line 13) | @Override
method getPrice (line 18) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/outputs/LabeledValueDisplay.java
class LabeledValueDisplay (line 13) | public class LabeledValueDisplay extends OnePinReadingWidget {
method setProperty (line 21) | @Override
method getModeType (line 32) | @Override
method getPrice (line 37) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/outputs/LevelDisplay.java
class LevelDisplay (line 11) | public class LevelDisplay extends OnePinReadingWidget {
method getModeType (line 17) | @Override
method getPrice (line 22) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/outputs/Map.java
class Map (line 21) | public class Map extends OnePinWidget {
method updateIfSame (line 39) | @Override
method sendAppSync (line 57) | @Override
method sendHardSync (line 70) | @Override
method getJsonValue (line 74) | @Override
method getModeType (line 79) | @Override
method getPrice (line 84) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/outputs/TextAlignment.java
type TextAlignment (line 8) | public enum TextAlignment {
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/outputs/ValueDisplay.java
class ValueDisplay (line 12) | public class ValueDisplay extends OnePinReadingWidget {
method getModeType (line 16) | @Override
method getPrice (line 21) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/outputs/VerticalLevelDisplay.java
class VerticalLevelDisplay (line 8) | public class VerticalLevelDisplay extends LevelDisplay {
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/outputs/graph/AggregationFunctionType.java
type AggregationFunctionType (line 15) | public enum AggregationFunctionType {
method produce (line 23) | public GraphFunction produce() {
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/outputs/graph/FontSize.java
type FontSize (line 8) | public enum FontSize {
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/outputs/graph/GoalLine.java
type GoalLine (line 8) | public enum GoalLine {
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/outputs/graph/GraphDataStream.java
class GraphDataStream (line 12) | public class GraphDataStream {
method GraphDataStream (line 57) | @JsonCreator
method getTargetId (line 102) | public int getTargetId(int targetIdOverride) {
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/outputs/graph/GraphGranularityType.java
type GraphGranularityType (line 8) | public enum GraphGranularityType {
method GraphGranularityType (line 20) | GraphGranularityType(String label, char type, long period) {
method getValues (line 26) | public static GraphGranularityType[] getValues() {
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/outputs/graph/GraphPeriod.java
type GraphPeriod (line 12) | public enum GraphPeriod {
method GraphPeriod (line 45) | GraphPeriod(int numberOfPoints, GraphGranularityType granularityType) {
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/outputs/graph/GraphType.java
type GraphType (line 8) | public enum GraphType {
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/outputs/graph/LineType.java
type LineType (line 3) | public enum LineType {
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/outputs/graph/Stacking.java
type Stacking (line 8) | public enum Stacking {
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/outputs/graph/Superchart.java
class Superchart (line 21) | public class Superchart extends Widget {
method hasLivePeriodsSelected (line 67) | public boolean hasLivePeriodsSelected() {
method getModeType (line 76) | @Override
method getPrice (line 82) | @Override
method updateValue (line 87) | @Override
method erase (line 91) | @Override
method isAssignedToDevice (line 95) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/outputs/graph/YAxisScale.java
type YAxisScale (line 3) | public enum YAxisScale {
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/sensors/Accelerometer.java
class Accelerometer (line 12) | public class Accelerometer extends OnePinWidget {
method getModeType (line 16) | @Override
method sendHardSync (line 21) | @Override
method getPrice (line 25) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/sensors/Barometer.java
class Barometer (line 12) | public class Barometer extends OnePinWidget {
method getModeType (line 16) | @Override
method sendHardSync (line 21) | @Override
method getPrice (line 25) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/sensors/GPSStreaming.java
class GPSStreaming (line 12) | public class GPSStreaming extends OnePinWidget {
method getModeType (line 20) | @Override
method sendHardSync (line 25) | @Override
method getPrice (line 29) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/sensors/GPSTrigger.java
class GPSTrigger (line 12) | public class GPSTrigger extends OnePinWidget {
method getModeType (line 24) | @Override
method sendHardSync (line 29) | @Override
method getPrice (line 33) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/sensors/Gravity.java
class Gravity (line 12) | public class Gravity extends OnePinWidget {
method getModeType (line 16) | @Override
method sendHardSync (line 21) | @Override
method getPrice (line 25) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/sensors/Humidity.java
class Humidity (line 12) | public class Humidity extends OnePinWidget {
method getModeType (line 16) | @Override
method sendHardSync (line 21) | @Override
method getPrice (line 25) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/sensors/Light.java
class Light (line 12) | public class Light extends OnePinWidget {
method getModeType (line 16) | @Override
method sendHardSync (line 21) | @Override
method getPrice (line 25) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/sensors/Proximity.java
class Proximity (line 12) | public class Proximity extends OnePinWidget {
method getModeType (line 16) | @Override
method sendHardSync (line 21) | @Override
method getPrice (line 25) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/sensors/Temperature.java
class Temperature (line 12) | public class Temperature extends OnePinWidget {
method getModeType (line 18) | @Override
method sendHardSync (line 23) | @Override
method getPrice (line 27) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/ui/DeviceSelector.java
class DeviceSelector (line 16) | public class DeviceSelector extends NoPinWidget implements Target, Devic...
method getDeviceIds (line 33) | @Override
method isSelected (line 38) | @Override
method getAssignedDeviceIds (line 43) | @Override
method contains (line 48) | @Override
method getDeviceId (line 53) | @Override
method getPrice (line 58) | @Override
method isAssignedToDevice (line 63) | @Override
method deleteDevice (line 68) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/ui/Menu.java
class Menu (line 15) | public class Menu extends OnePinWidget {
method getModeType (line 27) | @Override
method getPrice (line 32) | @Override
method setProperty (line 37) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/ui/Tab.java
class Tab (line 11) | public class Tab {
method Tab (line 17) | @JsonCreator
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/ui/Tabs.java
class Tabs (line 10) | public class Tabs extends NoPinWidget {
method Tabs (line 22) | public Tabs() {
method getPrice (line 26) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/ui/TimeInput.java
class TimeInput (line 21) | public class TimeInput extends OnePinWidget {
method updateIfSame (line 48) | @Override
method calcTime (line 71) | private static int calcTime(String value) {
method updateValue (line 84) | @Override
method erase (line 94) | @Override
method getModeType (line 100) | @Override
method getPrice (line 105) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/ui/image/Image.java
class Image (line 14) | public class Image extends OnePinWidget {
method setProperty (line 28) | @Override
method getModeType (line 58) | @Override
method getPrice (line 63) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/ui/image/ImageScaling.java
type ImageScaling (line 3) | public enum ImageScaling {
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/ui/image/ImageSource.java
type ImageSource (line 3) | public enum ImageSource {
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/ui/reporting/BaseReportTask.java
class BaseReportTask (line 38) | public abstract class BaseReportTask implements Runnable {
method BaseReportTask (line 55) | protected BaseReportTask(User user, int dashId, Report report,
method deviceAndPinFileName (line 65) | private static String deviceAndPinFileName(String deviceName, int devi...
method deviceFileName (line 70) | private static String deviceFileName(String deviceName, int deviceId) {
method run (line 74) | @Override
method sendEmail (line 84) | private void sendEmail(Path output) throws Exception {
method generateReport (line 92) | protected long generateReport() {
method generateReport (line 118) | private ReportResult generateReport(Path userCsvFolder, Profile profile,
method generateReport (line 137) | private boolean generateReport(Path output, Profile profile,
method merged (line 151) | private boolean merged(Path output, Profile profile, DashBoard dash,
method filePerDevice (line 184) | private boolean filePerDevice(Path output, Profile profile,
method filePerDevicePerPin (line 217) | private boolean filePerDevicePerPin(Path output, Profile profile,
method addZipEntryAndWrite (line 251) | private void addZipEntryAndWrite(ZipOutputStream zipStream,
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/ui/reporting/Format.java
type Format (line 3) | public enum Format {
method Format (line 12) | Format(String pattern) {
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/ui/reporting/PeriodicReportTask.java
class PeriodicReportTask (line 14) | public class PeriodicReportTask extends BaseReportTask {
method PeriodicReportTask (line 18) | PeriodicReportTask(User user, int dashId, Report report, ReportSchedul...
method run (line 25) | @Override
method reschedule (line 40) | private void reschedule(long reportFinishedAt) {
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/ui/reporting/Report.java
class Report (line 31) | public class Report {
method Report (line 61) | @JsonCreator
method isValid (line 90) | public boolean isValid() {
method isPeriodic (line 96) | public boolean isPeriodic() {
method getPrice (line 100) | public static int getPrice() {
method calculateDelayInSeconds (line 104) | public long calculateDelayInSeconds() throws IllegalCommandBodyExcepti...
method buildDynamicSection (line 123) | String buildDynamicSection() {
method getReportName (line 130) | public String getReportName() {
method makeFormatter (line 134) | public DateTimeFormatter makeFormatter() {
method toString (line 140) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/ui/reporting/ReportOutput.java
type ReportOutput (line 3) | public enum ReportOutput {
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/ui/reporting/ReportResult.java
type ReportResult (line 3) | public enum ReportResult {
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/ui/reporting/ReportScheduler.java
class ReportScheduler (line 29) | public class ReportScheduler extends ScheduledThreadPoolExecutor {
method ReportScheduler (line 38) | public ReportScheduler(int corePoolSize, String downloadUrl,
method init (line 50) | private void init(Map<UserKey, User> users) {
method schedule (line 94) | public void schedule(User user, int dashId, Report report, long delayI...
method schedule (line 102) | @Override
method cancelStoredFuture (line 112) | public void cancelStoredFuture(User user, int dashId) {
method cancelStoredFuture (line 127) | public boolean cancelStoredFuture(User user, int dashId, int reportId) {
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/ui/reporting/ReportTaskKey.java
class ReportTaskKey (line 5) | public class ReportTaskKey {
method ReportTaskKey (line 13) | public ReportTaskKey(User user, int dashId, int reportId) {
method equals (line 19) | @Override
method hashCode (line 39) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/ui/reporting/ReportingWidget.java
class ReportingWidget (line 21) | public class ReportingWidget extends NoPinWidget implements DeviceCleaner {
method validateId (line 37) | public void validateId(int id) {
method getReportById (line 44) | public Report getReportById(int id) {
method getReportIndexById (line 53) | public int getReportIndexById(int id) {
method hasPin (line 62) | public boolean hasPin(short pin, PinType pinType) {
method deleteDevice (line 71) | @Override
method getPrice (line 82) | @Override
method erase (line 87) | @Override
method updateValue (line 92) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/ui/reporting/source/DeviceReportSource.java
class DeviceReportSource (line 14) | public class DeviceReportSource extends ReportSource {
method DeviceReportSource (line 18) | @JsonCreator
method isValid (line 25) | @Override
method getDeviceIds (line 30) | @Override
method deleteDevice (line 35) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/ui/reporting/source/ReportDataStream.java
class ReportDataStream (line 14) | public class ReportDataStream {
method ReportDataStream (line 24) | @JsonCreator
method isSame (line 35) | public boolean isSame(short pin, PinType pinType) {
method isValid (line 39) | public boolean isValid() {
method formatForFileName (line 43) | public String formatForFileName() {
method formatAndEscapePin (line 50) | public String formatAndEscapePin() {
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/ui/reporting/source/ReportSource.java
class ReportSource (line 15) | @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type")
method ReportSource (line 24) | ReportSource(ReportDataStream[] reportDataStreams) {
method getDeviceIds (line 28) | public abstract int[] getDeviceIds();
method isValid (line 30) | public boolean isValid() {
method isSame (line 34) | public boolean isSame(short pin, PinType pinType) {
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/ui/reporting/source/TileTemplateReportSource.java
class TileTemplateReportSource (line 14) | public class TileTemplateReportSource extends ReportSource {
method TileTemplateReportSource (line 20) | @JsonCreator
method isValid (line 29) | @Override
method getDeviceIds (line 34) | @Override
method deleteDevice (line 39) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/ui/reporting/type/BaseReportType.java
class BaseReportType (line 16) | @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type")
method getNextTriggerTime (line 25) | public abstract ZonedDateTime getNextTriggerTime(ZonedDateTime zonedNo...
method isValid (line 27) | public abstract boolean isValid();
method getDuration (line 29) | public abstract long getDuration();
method getDurationLabel (line 31) | public abstract String getDurationLabel();
method buildDynamicSection (line 33) | public abstract void buildDynamicSection(StringBuilder sb, ZoneId zone...
method getFetchCount (line 35) | public long getFetchCount(GraphGranularityType granularity) {
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/ui/reporting/type/DailyReport.java
class DailyReport (line 16) | public class DailyReport extends BaseReportType {
method DailyReport (line 26) | @JsonCreator
method isValid (line 37) | @Override
method getDuration (line 42) | @Override
method getZonedFromTs (line 47) | static ZonedDateTime getZonedFromTs(long ts, ZoneId zoneId) {
method getDurationLabel (line 51) | @Override
method buildDynamicSection (line 56) | @Override
method addReportSpecificAtTime (line 74) | public void addReportSpecificAtTime(StringBuilder sb, ZoneId zoneId) {
method buildZonedStartAt (line 80) | ZonedDateTime buildZonedStartAt(ZonedDateTime zonedNow, ZoneId zoneId) {
method adjustToStartDate (line 90) | private ZonedDateTime adjustToStartDate(ZonedDateTime zonedStartAt, Zo...
method isExpired (line 103) | public boolean isExpired(ZonedDateTime zonedNow, ZoneId zoneId) {
method getNextTriggerTime (line 111) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/ui/reporting/type/DayOfMonth.java
type DayOfMonth (line 3) | public enum DayOfMonth {
method DayOfMonth (line 10) | DayOfMonth(String label) {
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/ui/reporting/type/MonthlyReport.java
class MonthlyReport (line 17) | public class MonthlyReport extends DailyReport {
method MonthlyReport (line 21) | @JsonCreator
method getDuration (line 31) | @Override
method getDurationLabel (line 36) | @Override
method addReportSpecificAtTime (line 41) | @Override
method getNextTriggerTime (line 47) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/ui/reporting/type/OneTimeReport.java
class OneTimeReport (line 15) | public class OneTimeReport extends BaseReportType {
method OneTimeReport (line 19) | @JsonCreator
method isValid (line 24) | @Override
method getDurationLabel (line 29) | @Override
method buildDynamicSection (line 34) | @Override
method getDuration (line 39) | @Override
method getNextTriggerTime (line 44) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/ui/reporting/type/ReportDurationType.java
type ReportDurationType (line 8) | public enum ReportDurationType {
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/ui/reporting/type/WeeklyReport.java
class WeeklyReport (line 18) | public class WeeklyReport extends DailyReport {
method WeeklyReport (line 23) | @JsonCreator
method getDuration (line 33) | @Override
method getDurationLabel (line 38) | @Override
method addReportSpecificAtTime (line 43) | @Override
method getNextTriggerTime (line 52) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/ui/table/Column.java
class Column (line 11) | public class Column {
method Column (line 15) | @JsonCreator
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/ui/table/Row.java
class Row (line 13) | public class Row {
method Row (line 23) | @JsonCreator
method update (line 34) | public void update(String name, String value) {
method toString (line 39) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/ui/table/Table.java
class Table (line 25) | public class Table extends OnePinWidget {
method sendHardSync (line 37) | @Override
method updateIfSame (line 41) | @Override
method sendAppSync (line 99) | @Override
method selectRow (line 113) | private void selectRow(String idString, boolean select) {
method get (line 121) | public Row get(int id) {
method getPinStorageValue (line 130) | @Override
method isMultiValueWidget (line 135) | @Override
method getModeType (line 140) | @Override
method getPrice (line 145) | @Override
method erase (line 150) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/ui/tiles/DeviceTiles.java
class DeviceTiles (line 31) | public class DeviceTiles extends Widget implements MobileSyncWidget, Har...
method deleteDeviceTilesByTemplateId (line 49) | public void deleteDeviceTilesByTemplateId(long deviceTileId) {
method recreateTilesIfNecessary (line 59) | public void recreateTilesIfNecessary(TileTemplate newTileTemplate, Til...
method preserveOldValueIfPossible (line 95) | private void preserveOldValueIfPossible(Tile[] existingTiles, Tile new...
method getTileTemplateByIdOrThrow (line 104) | public TileTemplate getTileTemplateByIdOrThrow(long id) {
method getTileTemplateById (line 108) | public TileTemplate getTileTemplateById(long id) {
method getTileTemplateIndexByIdOrThrow (line 117) | public int getTileTemplateIndexByIdOrThrow(long id) {
method getWidgetById (line 126) | public Widget getWidgetById(long widgetId) {
method getTileTemplateByWidgetIdOrThrow (line 137) | public TileTemplate getTileTemplateByWidgetIdOrThrow(long widgetId) {
method isSame (line 148) | @Override
method updateIfSame (line 158) | @Override
method sendAppSync (line 168) | @Override
method sendHardSync (line 180) | @Override
method getModeType (line 192) | @Override
method getPrice (line 197) | @Override
method updateValue (line 206) | @Override
method erase (line 220) | @Override
method getValue (line 232) | public String getValue(int deviceId, short pin, PinType pinType) {
method isAssignedToDevice (line 241) | @Override
method getTileIndexByDeviceId (line 246) | private static int getTileIndexByDeviceId(Tile[] tiles, int deviceId) {
method replaceTileTemplate (line 255) | public void replaceTileTemplate(TileTemplate newTileTemplate, int exis...
method deleteDevice (line 265) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/ui/tiles/SortType.java
type SortType (line 8) | public enum SortType {
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/ui/tiles/Tile.java
class Tile (line 13) | public class Tile {
method Tile (line 26) | @JsonCreator
method isSame (line 37) | public boolean isSame(int deviceId, short pin, PinType pinType) {
method updateIfSame (line 41) | public boolean updateIfSame(int deviceId, DataStream dataStream) {
method updateIfSame (line 48) | public boolean updateIfSame(int deviceId, short pin, PinType pinType, ...
method isValidDataStream (line 56) | public boolean isValidDataStream() {
method erase (line 60) | public void erase() {
method isTicked (line 66) | public boolean isTicked(long now) {
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/ui/tiles/TileMode.java
type TileMode (line 8) | public enum TileMode {
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/ui/tiles/TileTemplate.java
class TileTemplate (line 22) | @JsonTypeInfo(
method TileTemplate (line 52) | public TileTemplate(long id,
method getPrice (line 72) | public int getPrice() {
method erase (line 80) | public void erase() {
method isEmptyTemplateId (line 90) | public boolean isEmptyTemplateId() {
method getWidgetIndexByIdOrThrow (line 94) | public int getWidgetIndexByIdOrThrow(long widgetId) {
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/ui/tiles/templates/ButtonTileTemplate.java
class ButtonTileTemplate (line 15) | public class ButtonTileTemplate extends TileTemplate {
method ButtonTileTemplate (line 25) | @JsonCreator
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/ui/tiles/templates/DimmerTileTemplate.java
class DimmerTileTemplate (line 15) | public class DimmerTileTemplate extends TileTemplate {
method DimmerTileTemplate (line 37) | @JsonCreator
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/ui/tiles/templates/Interaction.java
type Interaction (line 3) | public enum Interaction {
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/ui/tiles/templates/PageTileTemplate.java
class PageTileTemplate (line 16) | public class PageTileTemplate extends TileTemplate {
method PageTileTemplate (line 34) | @JsonCreator
FILE: server/core/src/main/java/cc/blynk/server/core/model/widgets/ui/tiles/templates/State.java
class State (line 11) | public class State {
method State (line 23) | @JsonCreator
FILE: server/core/src/main/java/cc/blynk/server/core/processors/BaseProcessorHandler.java
class BaseProcessorHandler (line 18) | public abstract class BaseProcessorHandler {
method BaseProcessorHandler (line 25) | protected BaseProcessorHandler(EventorProcessor eventorProcessor, Webh...
method processEventorAndWebhook (line 30) | protected void processEventorAndWebhook(User user, DashBoard dash, int...
FILE: server/core/src/main/java/cc/blynk/server/core/processors/EventorProcessor.java
class EventorProcessor (line 46) | public class EventorProcessor {
method EventorProcessor (line 56) | public EventorProcessor(GCMWrapper gcmWrapper, MailWrapper mailWrapper...
method push (line 65) | public static void push(GCMWrapper gcmWrapper, DashBoard dash, String ...
method execute (line 81) | private void execute(User user, DashBoard dash, String triggerValue, N...
method process (line 93) | public void process(User user, Session session, DashBoard dash, int de...
method email (line 128) | private void email(User user, DashBoard dash, String subject, String b...
method twit (line 151) | private void twit(DashBoard dash, String body) {
method execute (line 186) | private void execute(Session session, Profile profile, DashBoard dash,
method execute (line 195) | private void execute(Session session, Profile profile, DashBoard dash,
FILE: server/core/src/main/java/cc/blynk/server/core/processors/NotificationBase.java
class NotificationBase (line 10) | public abstract class NotificationBase {
method NotificationBase (line 16) | public NotificationBase(long defaultNotificationQuotaLimit) {
method checkIfNotificationQuotaLimitIsNotReached (line 20) | protected void checkIfNotificationQuotaLimitIsNotReached() {
method checkIfNotificationQuotaLimitIsNotReached (line 24) | protected void checkIfNotificationQuotaLimitIsNotReached(final long cu...
FILE: server/core/src/main/java/cc/blynk/server/core/processors/WebhookProcessor.java
class WebhookProcessor (line 49) | public class WebhookProcessor extends NotificationBase {
method WebhookProcessor (line 60) | public WebhookProcessor(DefaultAsyncHttpClient httpclient,
method process (line 73) | public void process(User user, Session session, DashBoard dash, int de...
method process (line 87) | private void process(User user, Session session, int dashId, int devic...
method isValidResponseCode (line 178) | private static boolean isValidResponseCode(int responseCode) {
method format (line 191) | private static String format(String data, String triggerValue, String ...
FILE: server/core/src/main/java/cc/blynk/server/core/protocol/enums/Command.java
class Command (line 10) | public final class Command {
method Command (line 137) | private Command() {
method getNameByValue (line 229) | public static String getNameByValue(short val) {
FILE: server/core/src/main/java/cc/blynk/server/core/protocol/enums/Response.java
class Response (line 12) | public final class Response {
method Response (line 38) | private Response() {
method getNameByValue (line 41) | public static String getNameByValue(int val) {
FILE: server/core/src/main/java/cc/blynk/server/core/protocol/exceptions/BaseServerException.java
class BaseServerException (line 8) | public class BaseServerException extends RuntimeException {
method BaseServerException (line 16) | BaseServerException(String message, int msgId, int errorCode) {
method BaseServerException (line 22) | BaseServerException(String message, int errorCode) {
FILE: server/core/src/main/java/cc/blynk/server/core/protocol/exceptions/IllegalCommandBodyException.java
class IllegalCommandBodyException (line 10) | public class IllegalCommandBodyException extends BaseServerException {
method IllegalCommandBodyException (line 12) | public IllegalCommandBodyException(String message, int msgId) {
method IllegalCommandBodyException (line 16) | public IllegalCommandBodyException(String message) {
FILE: server/core/src/main/java/cc/blynk/server/core/protocol/exceptions/IllegalCommandException.java
class IllegalCommandException (line 10) | public class IllegalCommandException extends BaseServerException {
method IllegalCommandException (line 12) | public IllegalCommandException(String message) {
FILE: server/core/src/main/java/cc/blynk/server/core/protocol/exceptions/NoDataException.java
class NoDataException (line 11) | public class NoDataException extends Exception {
method NoDataException (line 13) | public NoDataException() {
FILE: server/core/src/main/java/cc/blynk/server/core/protocol/exceptions/NotAllowedException.java
class NotAllowedException (line 10) | public class NotAllowedException extends BaseServerException {
method NotAllowedException (line 12) | public NotAllowedException(String message, int msgId) {
FILE: server/core/src/main/java/cc/blynk/server/core/protocol/exceptions/QuotaLimitException.java
class QuotaLimitException (line 5) | public class QuotaLimitException extends BaseServerException {
method QuotaLimitException (line 7) | public QuotaLimitException(String message) {
method QuotaLimitException (line 11) | public QuotaLimitException(String message, int msgId) {
FILE: server/core/src/main/java/cc/blynk/server/core/protocol/exceptions/UnsupportedCommandException.java
class UnsupportedCommandException (line 10) | public class UnsupportedCommandException extends BaseServerException {
method UnsupportedCommandException (line 12) | public UnsupportedCommandException(String message, int msgId) {
FILE: server/core/src/main/java/cc/blynk/server/core/protocol/handlers/DefaultExceptionHandler.java
class DefaultExceptionHandler (line 20) | public abstract class DefaultExceptionHandler {
method handleBaseServerException (line 24) | public static void handleBaseServerException(ChannelHandlerContext ctx,
method handleGeneralException (line 32) | public static void handleGeneralException(ChannelHandlerContext ctx, T...
method handleUnexpectedException (line 41) | public static void handleUnexpectedException(ChannelHandlerContext ctx...
FILE: server/core/src/main/java/cc/blynk/server/core/protocol/handlers/decoders/MessageDecoder.java
class MessageDecoder (line 28) | public class MessageDecoder extends ByteToMessageDecoder {
method MessageDecoder (line 35) | public MessageDecoder(GlobalStats stats, Limits limits) {
method decode (line 40) | @Override
method getQuotaMeter (line 75) | public InstanceLoadMeter getQuotaMeter() {
FILE: server/core/src/main/java/cc/blynk/server/core/protocol/handlers/decoders/MobileMessageDecoder.java
class MobileMessageDecoder (line 30) | public class MobileMessageDecoder extends ByteToMessageDecoder {
method MobileMessageDecoder (line 40) | public MobileMessageDecoder(GlobalStats stats, Limits limits) {
method decode (line 45) | @Override
method validateLength (line 84) | private static void validateLength(int length) {
method getQuotaMeter (line 90) | public InstanceLoadMeter getQuotaMeter() {
FILE: server/core/src/main/java/cc/blynk/server/core/protocol/handlers/decoders/WSMessageDecoder.java
class WSMessageDecoder (line 27) | public class WSMessageDecoder extends ChannelInboundHandlerAdapter {
method WSMessageDecoder (line 34) | public WSMessageDecoder(GlobalStats globalStats, Limits limits) {
method channelRead (line 39) | @Override
method exceptionCaught (line 72) | @Override
method getQuotaMeter (line 79) | public InstanceLoadMeter getQuotaMeter() {
FILE: server/core/src/main/java/cc/blynk/server/core/protocol/handlers/encoders/MessageEncoder.java
class MessageEncoder (line 17) | public class MessageEncoder extends MessageToByteEncoder<MessageBase> {
method MessageEncoder (line 21) | public MessageEncoder(GlobalStats stats) {
method encode (line 25) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/protocol/handlers/encoders/MobileMessageEncoder.java
class MobileMessageEncoder (line 18) | @ChannelHandler.Sharable
method MobileMessageEncoder (line 23) | public MobileMessageEncoder(GlobalStats stats) {
method encode (line 27) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/protocol/handlers/encoders/WSMessageEncoder.java
class WSMessageEncoder (line 22) | @ChannelHandler.Sharable
method write (line 27) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/protocol/model/messages/BinaryMessage.java
class BinaryMessage (line 8) | public class BinaryMessage extends MessageBase {
method BinaryMessage (line 12) | public BinaryMessage(int messageId, short command, byte[] data) {
method getBytes (line 17) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/protocol/model/messages/MessageBase.java
class MessageBase (line 15) | public abstract class MessageBase {
method MessageBase (line 21) | public MessageBase(int id, short command) {
method getBytes (line 26) | public abstract byte[] getBytes();
method toString (line 28) | @Override
method equals (line 34) | @Override
method hashCode (line 51) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/protocol/model/messages/MessageFactory.java
class MessageFactory (line 26) | public final class MessageFactory {
method MessageFactory (line 28) | private MessageFactory() {
method produce (line 31) | public static MessageBase produce(int messageId, short commandId, Stri...
FILE: server/core/src/main/java/cc/blynk/server/core/protocol/model/messages/ResponseMessage.java
class ResponseMessage (line 11) | public class ResponseMessage extends MessageBase {
method ResponseMessage (line 15) | public ResponseMessage(int messageId, int responseCode) {
method getBytes (line 20) | @Override
method toString (line 25) | @Override
method equals (line 32) | @Override
method hashCode (line 49) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/protocol/model/messages/StringMessage.java
class StringMessage (line 11) | public class StringMessage extends MessageBase {
method StringMessage (line 16) | public StringMessage(int messageId, short command, String body, Charse...
method StringMessage (line 22) | public StringMessage(int messageId, short command, String body) {
method getBytes (line 26) | @Override
method toString (line 31) | @Override
method equals (line 36) | @Override
method hashCode (line 54) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/protocol/model/messages/appllication/GetServerMessage.java
class GetServerMessage (line 12) | public class GetServerMessage extends StringMessage {
method GetServerMessage (line 14) | public GetServerMessage(int messageId, String body) {
method toString (line 18) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/protocol/model/messages/appllication/LoginMessage.java
class LoginMessage (line 12) | public class LoginMessage extends StringMessage {
method LoginMessage (line 14) | public LoginMessage(int messageId, String body) {
method LoginMessage (line 18) | public LoginMessage(int messageId, short command, String body) {
method toString (line 22) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/protocol/model/messages/appllication/RegisterMessage.java
class RegisterMessage (line 12) | public class RegisterMessage extends StringMessage {
method RegisterMessage (line 14) | public RegisterMessage(int messageId, String body) {
method toString (line 18) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/protocol/model/messages/appllication/ResetPasswordMessage.java
class ResetPasswordMessage (line 12) | public class ResetPasswordMessage extends StringMessage {
method ResetPasswordMessage (line 14) | public ResetPasswordMessage(int messageId, String body) {
method toString (line 18) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/protocol/model/messages/appllication/sharing/ShareLoginMessage.java
class ShareLoginMessage (line 12) | public class ShareLoginMessage extends StringMessage {
method ShareLoginMessage (line 14) | public ShareLoginMessage(int messageId, String body) {
method toString (line 18) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/protocol/model/messages/common/HardwareMessage.java
class HardwareMessage (line 12) | public class HardwareMessage extends StringMessage {
method HardwareMessage (line 14) | public HardwareMessage(int messageId, String body) {
method toString (line 18) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/protocol/model/messages/hardware/HardwareLoginMessage.java
class HardwareLoginMessage (line 7) | public class HardwareLoginMessage extends LoginMessage {
method HardwareLoginMessage (line 9) | public HardwareLoginMessage(int messageId, String body) {
method toString (line 13) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/reporting/GraphPinRequest.java
class GraphPinRequest (line 19) | public class GraphPinRequest {
method GraphPinRequest (line 43) | public GraphPinRequest(int dashId, int[] deviceIds, DataStream dataStr...
method GraphPinRequest (line 63) | public GraphPinRequest(int dashId, int deviceId, DataStream dataStream,
method isLiveData (line 83) | public boolean isLiveData() {
method isValid (line 87) | public boolean isValid() {
method toString (line 91) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/reporting/average/AggregationKey.java
class AggregationKey (line 15) | public final class AggregationKey implements Serializable {
method AggregationKey (line 22) | public AggregationKey(String email, String appName, int dashId, int de...
method AggregationKey (line 26) | public AggregationKey(BaseReportingKey baseReportingKey, long ts) {
method getTs (line 31) | public long getTs(GraphGranularityType type) {
method isOutdated (line 35) | public boolean isOutdated(long nowTruncatedToPeriod) {
method getEmail (line 39) | public String getEmail() {
method getAppName (line 43) | public String getAppName() {
method getDashId (line 47) | public int getDashId() {
method getDeviceId (line 51) | public int getDeviceId() {
method getPinType (line 55) | public PinType getPinType() {
method getPin (line 59) | public short getPin() {
method equals (line 63) | @Override
method hashCode (line 82) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/reporting/average/AggregationValue.java
class AggregationValue (line 10) | public class AggregationValue implements Serializable {
method AggregationValue (line 15) | public AggregationValue() {
method AggregationValue (line 18) | AggregationValue(double value) {
method update (line 23) | public void update(double val) {
method calcAverage (line 28) | public double calcAverage() {
FILE: server/core/src/main/java/cc/blynk/server/core/reporting/average/AverageAggregatorProcessor.java
class AverageAggregatorProcessor (line 22) | public class AverageAggregatorProcessor implements Closeable {
method AverageAggregatorProcessor (line 37) | @SuppressWarnings("unchecked")
method aggregate (line 56) | private static void aggregate(Map<AggregationKey, AggregationValue> ma...
method collect (line 68) | public void collect(BaseReportingKey baseReportingKey, long ts, double...
method getMinute (line 74) | public ConcurrentHashMap<AggregationKey, AggregationValue> getMinute() {
method getHourly (line 78) | public ConcurrentHashMap<AggregationKey, AggregationValue> getHourly() {
method getDaily (line 82) | public ConcurrentHashMap<AggregationKey, AggregationValue> getDaily() {
method close (line 86) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/reporting/raw/BaseReportingKey.java
class BaseReportingKey (line 14) | public final class BaseReportingKey implements Serializable {
method BaseReportingKey (line 23) | public BaseReportingKey(User user, GraphPinRequest graphPinRequest) {
method BaseReportingKey (line 29) | public BaseReportingKey(String email, String appName, int dashId, int ...
method equals (line 38) | @Override
method hashCode (line 67) | @Override
FILE: server/core/src/main/java/cc/blynk/server/core/reporting/raw/GraphValue.java
class GraphValue (line 8) | public final class GraphValue {
method GraphValue (line 14) | public GraphValue(double value, long ts) {
FILE: server/core/src/main/java/cc/blynk/server/core/reporting/raw/RawDataCacheForGraphProcessor.java
class RawDataCacheForGraphProcessor (line 19) | public class RawDataCacheForGraphProcessor {
method RawDataCacheForGraphProcessor (line 25) | public RawDataCacheForGraphProcessor() {
method collect (line 29) | public void collect(BaseReportingKey baseReportingKey, GraphValue grap...
method getLiveGraphData (line 38) | public ByteBuffer getLiveGraphData(User user, GraphPinRequest graphPin...
method toByteBuffer (line 48) | private ByteBuffer toByteBuffer(LimitedArrayDeque<GraphValue> cache, i...
FILE: server/core/src/main/java/cc/blynk/server/core/reporting/raw/RawDataProcessor.java
class RawDataProcessor (line 19) | public class RawDataProcessor {
meth
Condensed preview — 782 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (4,184K chars).
[
{
"path": ".gitignore",
"chars": 98,
"preview": "# Created by .ignore support plugin (hsz.mobi)\n*.iml\n.idea\ntarget\n*.log\ndependency-reduced-pom.xml"
},
{
"path": ".travis.yml",
"chars": 227,
"preview": "language: java\n\njdk:\n - oraclejdk10\n\naddons:\n postgresql: \"9.5\"\n\nservices:\n - postgresql\n\nbefore_script:\n - psql -f "
},
{
"path": "CODE_OF_CONDUCT.md",
"chars": 3213,
"preview": "# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nIn the interest of fostering an open and welcoming environment, w"
},
{
"path": "CONTRIBUTING.md",
"chars": 792,
"preview": "## How to submit a bug report\n\nPlease ensure to specify the following:\n\n* Blynk Server version (e.g. 0.28.0)\n* Contextua"
},
{
"path": "README.md",
"chars": 27562,
"preview": "# What is Blynk?\n\n### Note that this Blynk Legacy server is now discontinued and unsupported!\nIt does not work with the "
},
{
"path": "apiary.apib",
"chars": 12737,
"preview": "FORMAT: 1A\nHOST: http://blynk-cloud.com/\n\n# Blynk HTTP RESTful API\n\nBlynk HTTP RESTful API allows to easily read and wri"
},
{
"path": "checkstyle.xml",
"chars": 7162,
"preview": "<?xml version=\"1.0\"?>\n<!DOCTYPE module PUBLIC\n \"-//Puppy Crawl//DTD Check Configuration 1.3//EN\"\n \"http://"
},
{
"path": "client/README.md",
"chars": 1974,
"preview": "## App Client (emulates Smartphone App)\n\n+ To emulate the Smartphone App client:\n\n java -jar client-${PUT_LATEST_"
},
{
"path": "client/pom.xml",
"chars": 2849,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2"
},
{
"path": "client/src/main/java/cc/blynk/client/ClientLauncher.java",
"chars": 2468,
"preview": "package cc.blynk.client;\n\nimport cc.blynk.client.core.ActiveHardwareClient;\nimport cc.blynk.client.core.AppClient;\nimpor"
},
{
"path": "client/src/main/java/cc/blynk/client/CommandParserUtil.java",
"chars": 10329,
"preview": "package cc.blynk.client;\n\nimport static cc.blynk.server.core.protocol.enums.Command.ACTIVATE_DASHBOARD;\nimport static cc"
},
{
"path": "client/src/main/java/cc/blynk/client/core/ActiveHardwareClient.java",
"chars": 3005,
"preview": "package cc.blynk.client.core;\n\nimport cc.blynk.client.handlers.ClientReplayingMessageDecoder;\nimport cc.blynk.client.han"
},
{
"path": "client/src/main/java/cc/blynk/client/core/AppClient.java",
"chars": 2947,
"preview": "package cc.blynk.client.core;\n\nimport cc.blynk.client.handlers.ClientReplayingMessageDecoder;\nimport cc.blynk.server.cor"
},
{
"path": "client/src/main/java/cc/blynk/client/core/BaseClient.java",
"chars": 7331,
"preview": "package cc.blynk.client.core;\n\nimport cc.blynk.client.CommandParserUtil;\nimport cc.blynk.server.core.protocol.model.mess"
},
{
"path": "client/src/main/java/cc/blynk/client/core/HardwareClient.java",
"chars": 1504,
"preview": "package cc.blynk.client.core;\n\nimport cc.blynk.client.handlers.ClientReplayingMessageDecoder;\nimport cc.blynk.server.cor"
},
{
"path": "client/src/main/java/cc/blynk/client/enums/ClientMode.java",
"chars": 489,
"preview": "package cc.blynk.client.enums;\n\n/**\n * The Blynk Project.\n * Created by Dmitriy Dumanskiy.\n * Created on 2/16/2015.\n */\n"
},
{
"path": "client/src/main/java/cc/blynk/client/handlers/ClientReplayingMessageDecoder.java",
"chars": 853,
"preview": "package cc.blynk.client.handlers;\n\nimport cc.blynk.client.handlers.decoders.ClientMessageDecoder;\nimport io.netty.channe"
},
{
"path": "client/src/main/java/cc/blynk/client/handlers/decoders/AppClientMessageDecoder.java",
"chars": 3053,
"preview": "package cc.blynk.client.handlers.decoders;\n\nimport cc.blynk.server.core.protocol.enums.Command;\nimport cc.blynk.server.c"
},
{
"path": "client/src/main/java/cc/blynk/client/handlers/decoders/ClientMessageDecoder.java",
"chars": 2912,
"preview": "package cc.blynk.client.handlers.decoders;\n\nimport cc.blynk.server.core.protocol.enums.Command;\nimport cc.blynk.server.c"
},
{
"path": "client/src/main/java/cc/blynk/client/handlers/hardware/HardwareEchoHandler.java",
"chars": 2776,
"preview": "package cc.blynk.client.handlers.hardware;\n\nimport cc.blynk.server.core.model.enums.PinType;\nimport cc.blynk.server.core"
},
{
"path": "client/src/main/resources/log4j2.xml",
"chars": 490,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<configuration>\n <appenders>\n <Console name=\"Console\" target=\"SYSTEM_OU"
},
{
"path": "client/src/main/resources/test.crt",
"chars": 1273,
"preview": "-----BEGIN CERTIFICATE-----\nMIIDfjCCAmYCCQD0IGVOPMSODzANBgkqhkiG9w0BAQUFADCBgDELMAkGA1UEBhMC\nVUExCjAIBgNVBAgMAVwxDTALBgN"
},
{
"path": "client/src/test/java/cc/blynk/client/ClientTest.java",
"chars": 1453,
"preview": "package cc.blynk.client;\n\nimport cc.blynk.client.core.AppClient;\nimport cc.blynk.client.core.HardwareClient;\nimport org."
},
{
"path": "docs/README_FOR_APP_DEVS.md",
"chars": 7477,
"preview": "# Protocol messages\n\nEvery message consists of 2 parts.\n\n+ Header :\n + Protocol command (1 byte);\n + MessageId (2 "
},
{
"path": "docs/websocket/Command.js",
"chars": 1207,
"preview": "var MsgType = {\n RESPONSE : 0,\n LOGIN : 2,\n PING : 6,\n TWEET : 12,\n EMA"
},
{
"path": "docs/websocket/README.MD",
"chars": 185,
"preview": "Usage :\n\n login AUTH_TOKEN\n hardware vw 1 1\n ping\n \nHave in mind socket will be closed in 15 seconds if no a"
},
{
"path": "docs/websocket/websocket.js.html",
"chars": 3993,
"preview": "<html>\n<head>\n <title>Web Socket Performance Test</title>\n</head>\n<body>\n\n<label>Connection Status:</label>\n<label id"
},
{
"path": "integration-tests/pom.xml",
"chars": 3815,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2"
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/BaseTest.java",
"chars": 3346,
"preview": "package cc.blynk.integration;\n\nimport cc.blynk.integration.model.tcp.ClientPair;\nimport cc.blynk.server.Holder;\nimport c"
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/CounterBase.java",
"chars": 981,
"preview": "package cc.blynk.integration;\n\nimport org.bouncycastle.jce.provider.BouncyCastleProvider;\nimport org.junit.Before;\n\nimpo"
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/MyHostVerifier.java",
"chars": 269,
"preview": "package cc.blynk.integration;\n\nimport javax.net.ssl.HostnameVerifier;\nimport javax.net.ssl.SSLSession;\n\npublic class MyH"
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/SingleServerInstancePerTest.java",
"chars": 2325,
"preview": "package cc.blynk.integration;\n\nimport cc.blynk.integration.model.tcp.ClientPair;\nimport cc.blynk.server.Holder;\nimport c"
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/SingleServerInstancePerTestWithDB.java",
"chars": 2436,
"preview": "package cc.blynk.integration;\n\nimport cc.blynk.integration.model.tcp.ClientPair;\nimport cc.blynk.server.Holder;\nimport c"
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/TestUtil.java",
"chars": 15278,
"preview": "package cc.blynk.integration;\n\nimport cc.blynk.integration.model.SimpleClientHandler;\nimport cc.blynk.integration.model."
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/http/AcmeTest.java",
"chars": 3106,
"preview": "package cc.blynk.integration.http;\n\nimport cc.blynk.integration.BaseTest;\nimport cc.blynk.server.Holder;\nimport cc.blynk"
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/http/HttpAPIKeepAliveServerTest.java",
"chars": 5546,
"preview": "package cc.blynk.integration.http;\n\nimport cc.blynk.integration.BaseTest;\nimport cc.blynk.server.servers.BaseServer;\nimp"
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/http/HttpAPIPinsAsyncClientTest.java",
"chars": 15634,
"preview": "package cc.blynk.integration.http;\n\nimport cc.blynk.integration.SingleServerInstancePerTest;\nimport cc.blynk.integration"
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/http/HttpAPIPinsTest.java",
"chars": 22567,
"preview": "package cc.blynk.integration.http;\n\nimport cc.blynk.integration.SingleServerInstancePerTest;\nimport cc.blynk.integration"
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/http/HttpAndTCPSameJVMTest.java",
"chars": 32862,
"preview": "package cc.blynk.integration.http;\n\nimport cc.blynk.integration.SingleServerInstancePerTest;\nimport cc.blynk.integration"
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/http/OTATest.java",
"chars": 29917,
"preview": "package cc.blynk.integration.http;\n\nimport cc.blynk.integration.BaseTest;\nimport cc.blynk.integration.MyHostVerifier;\nim"
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/http/UploadAPITest.java",
"chars": 3494,
"preview": "package cc.blynk.integration.http;\n\n\nimport cc.blynk.integration.BaseTest;\nimport cc.blynk.integration.TestUtil;\nimport "
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/https/HttpResetPassTest.java",
"chars": 5648,
"preview": "package cc.blynk.integration.https;\n\nimport cc.blynk.integration.BaseTest;\nimport cc.blynk.integration.TestUtil;\nimport "
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/https/HttpsAdminServerTest.java",
"chars": 21296,
"preview": "package cc.blynk.integration.https;\n\nimport cc.blynk.integration.BaseTest;\nimport cc.blynk.integration.MyHostVerifier;\ni"
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/model/MockHolder.java",
"chars": 1124,
"preview": "package cc.blynk.integration.model;\n\n\nimport cc.blynk.server.core.protocol.model.messages.MessageBase;\nimport cc.blynk.s"
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/model/SimpleClientHandler.java",
"chars": 525,
"preview": "package cc.blynk.integration.model;\n\nimport cc.blynk.server.core.protocol.model.messages.MessageBase;\nimport io.netty.ch"
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/model/http/PinJsonResponse.java",
"chars": 185,
"preview": "package cc.blynk.integration.model.http;\n\n/**\n * The Blynk Project.\n * Created by Dmitriy Dumanskiy.\n * Created on 28.12"
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/model/http/ResponseUserEntity.java",
"chars": 371,
"preview": "package cc.blynk.integration.model.http;\n\n/**\n * The Blynk Project.\n * Created by Dmitriy Dumanskiy.\n * Created on 24.12"
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/model/tcp/BaseTestAppClient.java",
"chars": 2311,
"preview": "package cc.blynk.integration.model.tcp;\n\nimport cc.blynk.client.core.AppClient;\nimport cc.blynk.integration.TestUtil;\nim"
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/model/tcp/BaseTestHardwareClient.java",
"chars": 1723,
"preview": "package cc.blynk.integration.model.tcp;\n\nimport cc.blynk.client.core.BaseClient;\nimport cc.blynk.integration.TestUtil;\ni"
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/model/tcp/ClientPair.java",
"chars": 581,
"preview": "package cc.blynk.integration.model.tcp;\n\n/**\n * The Blynk Project.\n * Created by Dmitriy Dumanskiy.\n * Created on 2/4/20"
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/model/tcp/TestAppClient.java",
"chars": 11708,
"preview": "package cc.blynk.integration.model.tcp;\n\nimport cc.blynk.client.handlers.decoders.AppClientMessageDecoder;\nimport cc.bly"
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/model/tcp/TestHardClient.java",
"chars": 2526,
"preview": "package cc.blynk.integration.model.tcp;\n\nimport cc.blynk.client.handlers.decoders.ClientMessageDecoder;\nimport cc.blynk."
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/model/tcp/TestSslHardClient.java",
"chars": 3931,
"preview": "package cc.blynk.integration.model.tcp;\n\nimport cc.blynk.client.handlers.decoders.ClientMessageDecoder;\nimport cc.blynk."
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/model/websocket/AppWebSocketClient.java",
"chars": 4574,
"preview": "/*\n * Copyright 2014 The Netty Project\n *\n * The Netty Project licenses this file to you under the Apache License,\n * ve"
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/model/websocket/AppWebSocketClientHandler.java",
"chars": 4708,
"preview": "/*\n * Copyright 2012 The Netty Project\n *\n * The Netty Project licenses this file to you under the Apache License,\n * ve"
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/model/websocket/WebSocketClient.java",
"chars": 4589,
"preview": "/*\n * Copyright 2014 The Netty Project\n *\n * The Netty Project licenses this file to you under the Apache License,\n * ve"
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/model/websocket/WebSocketClientHandler.java",
"chars": 4752,
"preview": "/*\n * Copyright 2012 The Netty Project\n *\n * The Netty Project licenses this file to you under the Apache License,\n * ve"
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/tcp/AppMailTest.java",
"chars": 10755,
"preview": "package cc.blynk.integration.tcp;\n\nimport cc.blynk.integration.SingleServerInstancePerTest;\nimport cc.blynk.integration."
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/tcp/AppOfflineTest.java",
"chars": 1869,
"preview": "package cc.blynk.integration.tcp;\n\nimport cc.blynk.integration.BaseTest;\nimport cc.blynk.integration.TestUtil;\nimport cc"
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/tcp/AppSyncWorkflowTest.java",
"chars": 49410,
"preview": "package cc.blynk.integration.tcp;\n\nimport cc.blynk.integration.SingleServerInstancePerTest;\nimport cc.blynk.integration."
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/tcp/AppWorkflowTest.java",
"chars": 5802,
"preview": "package cc.blynk.integration.tcp;\n\nimport cc.blynk.integration.SingleServerInstancePerTest;\nimport cc.blynk.server.core."
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/tcp/AssignTokenTest.java",
"chars": 3563,
"preview": "package cc.blynk.integration.tcp;\n\nimport cc.blynk.integration.SingleServerInstancePerTestWithDB;\nimport cc.blynk.integr"
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/tcp/BlynkInternalTest.java",
"chars": 4843,
"preview": "package cc.blynk.integration.tcp;\n\nimport cc.blynk.integration.SingleServerInstancePerTest;\nimport cc.blynk.integration."
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/tcp/BridgeWorkflowTest.java",
"chars": 19112,
"preview": "package cc.blynk.integration.tcp;\n\nimport cc.blynk.integration.SingleServerInstancePerTest;\nimport cc.blynk.integration."
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/tcp/CloneWorkFlowTest.java",
"chars": 6532,
"preview": "package cc.blynk.integration.tcp;\n\nimport cc.blynk.integration.SingleServerInstancePerTestWithDB;\nimport cc.blynk.server"
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/tcp/DeviceCommandsTest.java",
"chars": 5648,
"preview": "package cc.blynk.integration.tcp;\n\nimport cc.blynk.integration.SingleServerInstancePerTest;\nimport cc.blynk.server.core."
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/tcp/DeviceSelectorWorkflowTest.java",
"chars": 32384,
"preview": "package cc.blynk.integration.tcp;\n\nimport cc.blynk.integration.SingleServerInstancePerTest;\nimport cc.blynk.integration."
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/tcp/DeviceTilesWidgetTest.java",
"chars": 96858,
"preview": "package cc.blynk.integration.tcp;\n\nimport cc.blynk.integration.SingleServerInstancePerTest;\nimport cc.blynk.integration."
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/tcp/DeviceWorkflowTest.java",
"chars": 33168,
"preview": "package cc.blynk.integration.tcp;\n\nimport cc.blynk.integration.SingleServerInstancePerTest;\nimport cc.blynk.integration."
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/tcp/EnergyWorkflowTest.java",
"chars": 6026,
"preview": "package cc.blynk.integration.tcp;\n\nimport cc.blynk.integration.SingleServerInstancePerTest;\nimport cc.blynk.integration."
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/tcp/EventorTest.java",
"chars": 32879,
"preview": "package cc.blynk.integration.tcp;\n\nimport cc.blynk.integration.SingleServerInstancePerTest;\nimport cc.blynk.integration."
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/tcp/FacebookLoginTest.java",
"chars": 5201,
"preview": "package cc.blynk.integration.tcp;\n\nimport cc.blynk.integration.SingleServerInstancePerTest;\nimport cc.blynk.integration."
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/tcp/HistoryGraphTest.java",
"chars": 115277,
"preview": "package cc.blynk.integration.tcp;\n\nimport cc.blynk.integration.BaseTest;\nimport cc.blynk.integration.SingleServerInstanc"
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/tcp/LoadBalancingIntegrationTest.java",
"chars": 14101,
"preview": "package cc.blynk.integration.tcp;\n\nimport cc.blynk.integration.BaseTest;\nimport cc.blynk.integration.TestUtil;\nimport cc"
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/tcp/MainWorkflowTest.java",
"chars": 73887,
"preview": "package cc.blynk.integration.tcp;\n\nimport cc.blynk.integration.SingleServerInstancePerTest;\nimport cc.blynk.integration."
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/tcp/MultiAppTest.java",
"chars": 4227,
"preview": "package cc.blynk.integration.tcp;\n\nimport cc.blynk.integration.SingleServerInstancePerTest;\nimport cc.blynk.integration."
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/tcp/NotificationsLogicTest.java",
"chars": 28388,
"preview": "package cc.blynk.integration.tcp;\n\nimport cc.blynk.integration.SingleServerInstancePerTest;\nimport cc.blynk.integration."
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/tcp/OfflineNotificationTest.java",
"chars": 9485,
"preview": "package cc.blynk.integration.tcp;\n\nimport cc.blynk.integration.SingleServerInstancePerTest;\nimport cc.blynk.integration."
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/tcp/PortUnificationTest.java",
"chars": 2260,
"preview": "package cc.blynk.integration.tcp;\n\nimport cc.blynk.integration.SingleServerInstancePerTest;\nimport cc.blynk.integration."
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/tcp/PublishingPreviewFlow.java",
"chars": 47043,
"preview": "package cc.blynk.integration.tcp;\n\nimport cc.blynk.integration.SingleServerInstancePerTestWithDB;\nimport cc.blynk.integr"
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/tcp/ReadingWorkflowTest.java",
"chars": 14167,
"preview": "package cc.blynk.integration.tcp;\n\nimport cc.blynk.integration.SingleServerInstancePerTest;\nimport cc.blynk.integration."
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/tcp/RegistrationLimitCheckTest.java",
"chars": 992,
"preview": "package cc.blynk.integration.tcp;\n\nimport cc.blynk.integration.SingleServerInstancePerTest;\nimport cc.blynk.integration."
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/tcp/ReportingTest.java",
"chars": 113591,
"preview": "package cc.blynk.integration.tcp;\n\nimport cc.blynk.integration.BaseTest;\nimport cc.blynk.integration.model.tcp.ClientPai"
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/tcp/SetPropertyTest.java",
"chars": 22943,
"preview": "package cc.blynk.integration.tcp;\n\nimport cc.blynk.integration.SingleServerInstancePerTest;\nimport cc.blynk.server.core."
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/tcp/ShareProfileWorkflowTest.java",
"chars": 36476,
"preview": "package cc.blynk.integration.tcp;\n\nimport cc.blynk.integration.SingleServerInstancePerTest;\nimport cc.blynk.integration."
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/tcp/SimplePerformanceTest.java",
"chars": 3053,
"preview": "package cc.blynk.integration.tcp;\n\nimport cc.blynk.integration.SingleServerInstancePerTest;\nimport cc.blynk.integration."
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/tcp/SyncWorkflowTest.java",
"chars": 34475,
"preview": "package cc.blynk.integration.tcp;\n\nimport cc.blynk.integration.SingleServerInstancePerTest;\nimport cc.blynk.integration."
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/tcp/TableCommandsTest.java",
"chars": 10649,
"preview": "package cc.blynk.integration.tcp;\n\nimport cc.blynk.integration.SingleServerInstancePerTest;\nimport cc.blynk.server.core."
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/tcp/TagCommandsTest.java",
"chars": 9074,
"preview": "package cc.blynk.integration.tcp;\n\nimport cc.blynk.integration.SingleServerInstancePerTest;\nimport cc.blynk.integration."
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/tcp/TimerTest.java",
"chars": 30405,
"preview": "package cc.blynk.integration.tcp;\n\nimport cc.blynk.integration.SingleServerInstancePerTest;\nimport cc.blynk.integration."
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/tcp/WebhookTest.java",
"chars": 27545,
"preview": "package cc.blynk.integration.tcp;\n\nimport cc.blynk.integration.SingleServerInstancePerTest;\nimport cc.blynk.server.core."
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/tcp/WidgetWorkflowTest.java",
"chars": 8098,
"preview": "package cc.blynk.integration.tcp;\n\nimport cc.blynk.integration.SingleServerInstancePerTest;\nimport cc.blynk.server.core."
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/tools/FlahsedTokenGenerator.java",
"chars": 1957,
"preview": "package cc.blynk.integration.tools;\n\nimport cc.blynk.server.core.BlockingIOProcessor;\nimport cc.blynk.server.db.DBManage"
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/tools/ProjectTokenGenerator.java",
"chars": 2559,
"preview": "package cc.blynk.integration.tools;\n\nimport cc.blynk.server.core.dao.TokenManager;\nimport cc.blynk.server.core.model.Das"
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/tools/QRGenerator.java",
"chars": 1687,
"preview": "package cc.blynk.integration.tools;\n\nimport cc.blynk.server.core.BlockingIOProcessor;\nimport cc.blynk.server.db.DBManage"
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/tools/TokenGenerator.java",
"chars": 1769,
"preview": "package cc.blynk.integration.tools;\n\nimport cc.blynk.server.core.BlockingIOProcessor;\nimport cc.blynk.server.db.DBManage"
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/tools/UserReader.java",
"chars": 1172,
"preview": "package cc.blynk.integration.tools;\n\nimport cc.blynk.server.core.BlockingIOProcessor;\nimport cc.blynk.server.core.dao.Us"
},
{
"path": "integration-tests/src/test/java/cc/blynk/integration/websocket/WebSocketTest.java",
"chars": 6775,
"preview": "package cc.blynk.integration.websocket;\n\nimport cc.blynk.integration.BaseTest;\nimport cc.blynk.integration.model.tcp.Cli"
},
{
"path": "integration-tests/src/test/resources/db-test.properties",
"chars": 330,
"preview": "jdbc.url=jdbc:postgresql://localhost:5432/blynk?tcpKeepAlive=true&socketTimeout=150\nuser=test\npassword=test\nconnection.t"
},
{
"path": "integration-tests/src/test/resources/json_test/user_profile_json.txt",
"chars": 7415,
"preview": "{\n \"dashBoards\" :\n [\n {\n \"id\":1,\n \"name\":\"My Dashboard\",\n \"isAc"
},
{
"path": "integration-tests/src/test/resources/json_test/user_profile_json_2.txt",
"chars": 696,
"preview": "{\n \"dashBoards\" :\n [\n {\n \"id\":555,\n \"name\":\"MSecond\",\n \"isActiv"
},
{
"path": "integration-tests/src/test/resources/json_test/user_profile_json_3_dashes.txt",
"chars": 3084,
"preview": "{\n \"dashBoards\" :\n [\n {\n \"id\":1,\n \"name\":\"My Dashboard\",\n \"isAc"
},
{
"path": "integration-tests/src/test/resources/json_test/user_profile_json_empty_dash.txt",
"chars": 572,
"preview": "{\n \"dashBoards\" :\n [\n {\n \"id\":1,\n \"name\":\"My Dashboard\",\n \"isAc"
},
{
"path": "integration-tests/src/test/resources/json_test/user_profile_json_many_dashes.txt",
"chars": 2428,
"preview": "{\n \"dashBoards\" :\n [\n {\n \"id\":1,\n \"name\":\"My Dashboard\",\n \"crea"
},
{
"path": "integration-tests/src/test/resources/log4j2-test.xml",
"chars": 522,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<configuration status=\"INFO\">\n <appenders>\n <Console name=\"Console\" tar"
},
{
"path": "integration-tests/src/test/resources/no_certs.properties",
"chars": 1881,
"preview": "#hardware mqtt port\nhardware.mqtt.port=19440\n\nserver.ssl.cert=\nserver.ssl.key=\nserver.ssl.key.pass=\nclient.ssl.cert=\ncli"
},
{
"path": "integration-tests/src/test/resources/profiles/u_dmitriy@blynk.cc.user",
"chars": 24420,
"preview": "{\n \"dashShareTokens\":{\n \"125564119\":\"d81282986cb94920a82216d29d67a2b8\",\n \"79780619\":\"f1554962745e40d3871f2e3"
},
{
"path": "integration-tests/src/test/resources/server.properties",
"chars": 2261,
"preview": "#hardware mqtt port\nhardware.mqtt.port=18440\n\nserver.ssl.cert=/test-certs/mutual/server.crt\nserver.ssl.key=/test-certs/m"
},
{
"path": "integration-tests/src/test/resources/server2.properties",
"chars": 1969,
"preview": "#hardware mqtt port\nhardware.mqtt.port=19440\n\nserver.ssl.cert=/test-certs/mutual/server.crt\nserver.ssl.key=/test-certs/m"
},
{
"path": "integration-tests/src/test/resources/test-certs/mutual/app.crt",
"chars": 1111,
"preview": "-----BEGIN CERTIFICATE-----\nMIIDBjCCAe4CCQCaLWxpmJwnpjANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJB\nVTETMBEGA1UECBMKU29tZS1TdGF"
},
{
"path": "integration-tests/src/test/resources/test-certs/mutual/app.pem",
"chars": 1785,
"preview": "-----BEGIN ENCRYPTED PRIVATE KEY-----\nMIIE6TAbBgkqhkiG9w0BBQMwDgQIkBreBoHBYE4CAggABIIEyNYrlojzCRgWAWtN\nV04Ue/rdkF3AWCplj"
},
{
"path": "integration-tests/src/test/resources/test-certs/mutual/server.crt",
"chars": 1111,
"preview": "-----BEGIN CERTIFICATE-----\nMIIDBjCCAe4CCQDeI3qPsbJ7lDANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJB\nVTETMBEGA1UECBMKU29tZS1TdGF"
},
{
"path": "integration-tests/src/test/resources/test-certs/mutual/server.pem",
"chars": 1785,
"preview": "-----BEGIN ENCRYPTED PRIVATE KEY-----\nMIIE6TAbBgkqhkiG9w0BBQMwDgQIqE0NvK+pXK8CAggABIIEyMR3e2tVE8QaSvTy\nX8x0HHYrIsxR2CCZ4"
},
{
"path": "integration-tests/src/test/resources/twitter4j.properties",
"chars": 351,
"preview": "## For local servers you should fill this fields by yourself\n## Go here https://apps.twitter.com/\n## Create twitter app."
},
{
"path": "license.txt",
"chars": 35142,
"preview": " GNU GENERAL PUBLIC LICENSE\n Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
},
{
"path": "new_server_install.md",
"chars": 1956,
"preview": " sudo apt-get update\n sudo apt-get install fail2ban\n sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/"
},
{
"path": "pom.xml",
"chars": 8267,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2"
},
{
"path": "scripts/copy_to_qa.sh",
"chars": 98,
"preview": "#!/bin/sh\n\nscp ../server/launcher/target/server-0.41.12-SNAPSHOT.jar root@warmboard.blynk.cc:/root"
},
{
"path": "scripts/db",
"chars": 85,
"preview": "sudo -u postgres /usr/lib/postgresql/9.5/bin/pg_ctl -D /etc/postgresql/9.5/main start"
},
{
"path": "scripts/help_tools.sh",
"chars": 346,
"preview": "#!/usr/bin/env bash\n\nsudo apt-get update\nsudo apt-get install fail2ban\nsudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jai"
},
{
"path": "scripts/native_openssl.sh",
"chars": 513,
"preview": "#!/usr/bin/env bash\nwget http://apache.ip-connect.vn.ua/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz\nsudo "
},
{
"path": "scripts/ulimit",
"chars": 182,
"preview": "sudo nano /etc/security/limits.conf\nroot soft nofile 100000\nroot hard nofile 100000\n\nsudo nano /"
},
{
"path": "scripts/userfull_commands",
"chars": 1239,
"preview": "View number of open connections : netstat -an | awk '/^tcp/ {print $NF}' | sort | uniq -c | sort -rn\nNumber of files : f"
},
{
"path": "scripts/win/README.md",
"chars": 575,
"preview": "# StartBlynkServer.cmd\n\nThis batch file allows you to run local server in simpler way. Placing it alongside the server f"
},
{
"path": "scripts/win/StartBlynkServer.cmd",
"chars": 976,
"preview": "@echo off\necho **************************\necho Starting Blynk Server\necho Script created by\necho Waleed El-Badry\necho wa"
},
{
"path": "server/Docker/Dockerfile",
"chars": 2374,
"preview": "FROM ubuntu\nMAINTAINER Florian Mauduit <f@lf.je>\n\n#############################################################\n#\n# ENV "
},
{
"path": "server/Docker/README.md",
"chars": 596,
"preview": "## HOW TO \n\n### Configure\n\nJust edit the Dockerfile and change ENV vars\n\n\n### Build\n\n```bash\ndocker build -t blynk .\n```"
},
{
"path": "server/Docker/bin/run.sh",
"chars": 2095,
"preview": "#!/bin/bash\n\nset -e\n\necho \"hardware.mqtt.port=${HARDWARE_MQTT_PORT}\nhardware.ssl.port=${HARDWARE_MQTT_PORT_SSL}\nhttp.por"
},
{
"path": "server/acme/pom.xml",
"chars": 973,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2"
},
{
"path": "server/acme/src/main/java/cc/blynk/server/acme/AcmeClient.java",
"chars": 7996,
"preview": "package cc.blynk.server.acme;\n\nimport org.apache.logging.log4j.LogManager;\nimport org.apache.logging.log4j.Logger;\nimpor"
},
{
"path": "server/acme/src/main/java/cc/blynk/server/acme/ContentHolder.java",
"chars": 187,
"preview": "package cc.blynk.server.acme;\n\n/**\n * The Blynk Project.\n * Created by Dmitriy Dumanskiy.\n * Created on 30.04.17.\n */\npu"
},
{
"path": "server/acme/src/main/java/module-info.java",
"chars": 268,
"preview": "/**\n * The Blynk Project.\n * Created by Dmitriy Dumanskiy.\n * Created on 05.10.17.\n */\nmodule cc.blynk.server.acme {\n "
},
{
"path": "server/core/pom.xml",
"chars": 4020,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2"
},
{
"path": "server/core/src/main/java/cc/blynk/server/Holder.java",
"chars": 10356,
"preview": "package cc.blynk.server;\n\nimport cc.blynk.server.core.BlockingIOProcessor;\nimport cc.blynk.server.core.dao.FileManager;\n"
},
{
"path": "server/core/src/main/java/cc/blynk/server/Limits.java",
"chars": 3003,
"preview": "package cc.blynk.server;\n\nimport cc.blynk.utils.properties.ServerProperties;\n\n/**\n * This is helper class for holding al"
},
{
"path": "server/core/src/main/java/cc/blynk/server/SslContextHolder.java",
"chars": 7727,
"preview": "package cc.blynk.server;\n\nimport cc.blynk.server.acme.AcmeClient;\nimport cc.blynk.server.acme.ContentHolder;\nimport cc.b"
},
{
"path": "server/core/src/main/java/cc/blynk/server/TextHolder.java",
"chars": 1843,
"preview": "package cc.blynk.server;\n\nimport cc.blynk.utils.properties.GCMProperties;\n\nimport static cc.blynk.utils.FileLoaderUtil.r"
},
{
"path": "server/core/src/main/java/cc/blynk/server/common/BaseSimpleChannelInboundHandler.java",
"chars": 2721,
"preview": "package cc.blynk.server.common;\n\nimport cc.blynk.server.core.protocol.exceptions.BaseServerException;\nimport cc.blynk.se"
},
{
"path": "server/core/src/main/java/cc/blynk/server/common/handlers/AlreadyLoggedHandler.java",
"chars": 1505,
"preview": "package cc.blynk.server.common.handlers;\n\nimport cc.blynk.server.core.protocol.model.messages.MessageBase;\nimport cc.bly"
},
{
"path": "server/core/src/main/java/cc/blynk/server/common/handlers/UserNotLoggedHandler.java",
"chars": 1396,
"preview": "package cc.blynk.server.common.handlers;\n\nimport cc.blynk.server.core.protocol.model.messages.MessageBase;\nimport cc.bly"
},
{
"path": "server/core/src/main/java/cc/blynk/server/common/handlers/logic/PingLogic.java",
"chars": 522,
"preview": "package cc.blynk.server.common.handlers.logic;\n\nimport io.netty.channel.ChannelHandlerContext;\n\nimport static cc.blynk.s"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/BlockingIOProcessor.java",
"chars": 3311,
"preview": "package cc.blynk.server.core;\n\nimport cc.blynk.utils.BlynkTPFactory;\n\nimport java.io.Closeable;\nimport java.util.concurr"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/dao/CSVGenerator.java",
"chars": 3023,
"preview": "package cc.blynk.server.core.dao;\n\nimport cc.blynk.server.core.model.DataStream;\nimport cc.blynk.server.core.model.auth."
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/dao/FileManager.java",
"chars": 11241,
"preview": "package cc.blynk.server.core.dao;\n\nimport cc.blynk.server.core.model.DashBoard;\nimport cc.blynk.server.core.model.auth.U"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/dao/RegularTokenManager.java",
"chars": 2648,
"preview": "package cc.blynk.server.core.dao;\n\nimport cc.blynk.server.core.model.DashBoard;\nimport cc.blynk.server.core.model.auth.U"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/dao/ReportingDiskDao.java",
"chars": 14618,
"preview": "package cc.blynk.server.core.dao;\n\nimport cc.blynk.server.core.dao.functions.GraphFunction;\nimport cc.blynk.server.core."
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/dao/SessionDao.java",
"chars": 3665,
"preview": "package cc.blynk.server.core.dao;\n\nimport cc.blynk.server.core.model.auth.Session;\nimport cc.blynk.server.core.model.aut"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/dao/SharedTokenManager.java",
"chars": 1892,
"preview": "package cc.blynk.server.core.dao;\n\nimport cc.blynk.server.core.model.DashBoard;\nimport cc.blynk.server.core.model.auth.U"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/dao/SharedTokenValue.java",
"chars": 371,
"preview": "package cc.blynk.server.core.dao;\n\nimport cc.blynk.server.core.model.auth.User;\n\n/**\n * The Blynk Project.\n * Created by"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/dao/TemporaryTokenValue.java",
"chars": 823,
"preview": "package cc.blynk.server.core.dao;\n\nimport cc.blynk.server.core.model.DashBoard;\nimport cc.blynk.server.core.model.auth.U"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/dao/TokenManager.java",
"chars": 3468,
"preview": "package cc.blynk.server.core.dao;\n\nimport cc.blynk.server.core.model.DashBoard;\nimport cc.blynk.server.core.model.auth.U"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/dao/TokenValue.java",
"chars": 676,
"preview": "package cc.blynk.server.core.dao;\n\nimport cc.blynk.server.core.model.DashBoard;\nimport cc.blynk.server.core.model.auth.U"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/dao/UserDao.java",
"chars": 13195,
"preview": "package cc.blynk.server.core.dao;\n\nimport cc.blynk.server.core.model.DashBoard;\nimport cc.blynk.server.core.model.auth.A"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/dao/UserKey.java",
"chars": 1487,
"preview": "package cc.blynk.server.core.dao;\n\nimport cc.blynk.server.core.model.auth.User;\nimport cc.blynk.utils.AppNameUtil;\n\nimpo"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/dao/functions/AverageGraphFunction.java",
"chars": 528,
"preview": "package cc.blynk.server.core.dao.functions;\n\n/**\n * The Blynk Project.\n * Created by Dmitriy Dumanskiy.\n * Created on 21"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/dao/functions/GraphFunction.java",
"chars": 224,
"preview": "package cc.blynk.server.core.dao.functions;\n\n/**\n * The Blynk Project.\n * Created by Dmitriy Dumanskiy.\n * Created on 21"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/dao/functions/MaxGraphFunction.java",
"chars": 422,
"preview": "package cc.blynk.server.core.dao.functions;\n\n/**\n * The Blynk Project.\n * Created by Dmitriy Dumanskiy.\n * Created on 21"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/dao/functions/MedianGraphFunction.java",
"chars": 745,
"preview": "package cc.blynk.server.core.dao.functions;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\n\n/**\n * The Blynk"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/dao/functions/MinGraphFunction.java",
"chars": 423,
"preview": "package cc.blynk.server.core.dao.functions;\n\n/**\n * The Blynk Project.\n * Created by Dmitriy Dumanskiy.\n * Created on 21"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/dao/functions/SumGraphFunction.java",
"chars": 443,
"preview": "package cc.blynk.server.core.dao.functions;\n\n/**\n * The Blynk Project.\n * Created by Dmitriy Dumanskiy.\n * Created on 21"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/dao/ota/OTAInfo.java",
"chars": 1461,
"preview": "package cc.blynk.server.core.dao.ota;\n\nimport static cc.blynk.utils.StringUtils.BODY_SEPARATOR;\n\n/**\n * The Blynk Projec"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/dao/ota/OTAManager.java",
"chars": 4901,
"preview": "package cc.blynk.server.core.dao.ota;\n\nimport cc.blynk.server.core.dao.UserKey;\nimport cc.blynk.server.core.model.DashBo"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/model/DashBoard.java",
"chars": 17133,
"preview": "package cc.blynk.server.core.model;\n\nimport cc.blynk.server.core.dao.UserKey;\nimport cc.blynk.server.core.model.device.D"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/model/DashboardSettings.java",
"chars": 1789,
"preview": "package cc.blynk.server.core.model;\n\nimport cc.blynk.server.core.model.enums.Theme;\nimport com.fasterxml.jackson.annotat"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/model/DataStream.java",
"chars": 5095,
"preview": "package cc.blynk.server.core.model;\n\nimport cc.blynk.server.core.model.enums.PinType;\nimport cc.blynk.server.core.model."
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/model/Profile.java",
"chars": 18229,
"preview": "package cc.blynk.server.core.model;\n\nimport cc.blynk.server.core.model.auth.App;\nimport cc.blynk.server.core.model.devic"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/model/auth/App.java",
"chars": 2015,
"preview": "package cc.blynk.server.core.model.auth;\n\nimport cc.blynk.server.core.model.enums.ProvisionType;\nimport cc.blynk.server."
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/model/auth/FacebookTokenResponse.java",
"chars": 433,
"preview": "package cc.blynk.server.core.model.auth;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jack"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/model/auth/Session.java",
"chars": 9757,
"preview": "package cc.blynk.server.core.model.auth;\n\nimport cc.blynk.server.common.BaseSimpleChannelInboundHandler;\nimport cc.blynk"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/model/auth/User.java",
"chars": 5109,
"preview": "package cc.blynk.server.core.model.auth;\n\nimport cc.blynk.server.core.model.DashBoard;\nimport cc.blynk.server.core.model"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/model/device/BoardType.java",
"chars": 3434,
"preview": "package cc.blynk.server.core.model.device;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.ja"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/model/device/ConnectionType.java",
"chars": 230,
"preview": "package cc.blynk.server.core.model.device;\n\n/**\n * The Blynk Project.\n * Created by Dmitriy Dumanskiy.\n * Created on 16."
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/model/device/Device.java",
"chars": 4068,
"preview": "package cc.blynk.server.core.model.device;\n\nimport cc.blynk.server.core.model.serialization.JsonParser;\nimport cc.blynk."
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/model/device/DeviceOtaInfo.java",
"chars": 775,
"preview": "package cc.blynk.server.core.model.device;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.ja"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/model/device/DeviceStatusDTO.java",
"chars": 1558,
"preview": "package cc.blynk.server.core.model.device;\n\n/**\n * The Blynk Project.\n * Created by Dmitriy Dumanskiy.\n * Created on 18."
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/model/device/HardwareInfo.java",
"chars": 2654,
"preview": "package cc.blynk.server.core.model.device;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.ja"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/model/device/HardwareInfoPrivate.java",
"chars": 1872,
"preview": "package cc.blynk.server.core.model.device;\n\n//utility class to make fields of HardwareInfo final, used instead of hashma"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/model/device/Status.java",
"chars": 180,
"preview": "package cc.blynk.server.core.model.device;\n\n/**\n * The Blynk Project.\n * Created by Dmitriy Dumanskiy.\n * Created on 16."
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/model/device/Tag.java",
"chars": 2393,
"preview": "package cc.blynk.server.core.model.device;\n\nimport cc.blynk.server.core.model.serialization.JsonParser;\nimport cc.blynk."
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/model/enums/PinMode.java",
"chars": 282,
"preview": "package cc.blynk.server.core.model.enums;\n\n/**\n * Defines type of widget.\n * OUT means that widget writes to pin.\n * IN "
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/model/enums/PinType.java",
"chars": 880,
"preview": "package cc.blynk.server.core.model.enums;\n\n/**\n * User: ddumanskiy\n * Date: 10.12.13\n * Time: 10:15\n */\npublic enum PinT"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/model/enums/ProvisionType.java",
"chars": 186,
"preview": "package cc.blynk.server.core.model.enums;\n\n/**\n * The Blynk Project.\n * Created by Dmitriy Dumanskiy.\n * Created on 20.0"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/model/enums/Theme.java",
"chars": 341,
"preview": "package cc.blynk.server.core.model.enums;\n\n/**\n * The Blynk Project.\n * Created by Dmitriy Dumanskiy.\n * Created on 20.0"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/model/enums/WidgetProperty.java",
"chars": 2449,
"preview": "package cc.blynk.server.core.model.enums;\n\n/**\n * The Blynk Project.\n * Created by Dmitriy Dumanskiy.\n * Created on 19.1"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/model/graph/GraphKey.java",
"chars": 1320,
"preview": "package cc.blynk.server.core.model.graph;\n\nimport cc.blynk.server.core.model.enums.PinType;\nimport cc.blynk.utils.Number"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/model/serialization/CopyUtil.java",
"chars": 1973,
"preview": "package cc.blynk.server.core.model.serialization;\n\nimport cc.blynk.server.core.model.DashBoard;\nimport cc.blynk.server.c"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/model/serialization/JsonParser.java",
"chars": 11285,
"preview": "package cc.blynk.server.core.model.serialization;\n\nimport cc.blynk.server.core.model.DashBoard;\nimport cc.blynk.server.c"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/model/serialization/View.java",
"chars": 483,
"preview": "package cc.blynk.server.core.model.serialization;\n\npublic class View {\n\n /**\n * special marker class that used to"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/model/storage/DashPinStorageKeyDeserializer.java",
"chars": 1552,
"preview": "package cc.blynk.server.core.model.storage;\n\nimport cc.blynk.server.core.model.enums.PinType;\nimport cc.blynk.server.cor"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/model/storage/PinStorageKeyDeserializer.java",
"chars": 1631,
"preview": "package cc.blynk.server.core.model.storage;\n\nimport cc.blynk.server.core.model.enums.PinType;\nimport cc.blynk.server.cor"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/model/storage/PinStorageValueDeserializer.java",
"chars": 2247,
"preview": "package cc.blynk.server.core.model.storage;\n\nimport cc.blynk.server.core.model.storage.value.MultiPinStorageValue;\nimpor"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/model/storage/key/DashPinPropertyStorageKey.java",
"chars": 2210,
"preview": "package cc.blynk.server.core.model.storage.key;\n\nimport cc.blynk.server.core.model.enums.PinType;\nimport cc.blynk.server"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/model/storage/key/DashPinStorageKey.java",
"chars": 3003,
"preview": "package cc.blynk.server.core.model.storage.key;\n\nimport cc.blynk.server.core.model.DataStream;\nimport cc.blynk.server.co"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/model/storage/key/PinPropertyStorageKey.java",
"chars": 1668,
"preview": "package cc.blynk.server.core.model.storage.key;\n\nimport cc.blynk.server.core.model.enums.PinType;\nimport cc.blynk.server"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/model/storage/key/PinStorageKey.java",
"chars": 2361,
"preview": "package cc.blynk.server.core.model.storage.key;\n\nimport cc.blynk.server.core.model.DataStream;\nimport cc.blynk.server.co"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/model/storage/value/MultiPinStorageValue.java",
"chars": 2559,
"preview": "package cc.blynk.server.core.model.storage.value;\n\nimport cc.blynk.server.core.model.storage.key.DashPinStorageKey;\nimpo"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/model/storage/value/MultiPinStorageValueType.java",
"chars": 865,
"preview": "package cc.blynk.server.core.model.storage.value;\n\nimport cc.blynk.utils.structure.BaseLimitedQueue;\nimport cc.blynk.uti"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/model/storage/value/PinStorageValue.java",
"chars": 507,
"preview": "package cc.blynk.server.core.model.storage.value;\n\nimport cc.blynk.server.core.model.storage.key.DashPinStorageKey;\nimpo"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/model/storage/value/SinglePinStorageValue.java",
"chars": 1824,
"preview": "package cc.blynk.server.core.model.storage.value;\n\nimport cc.blynk.server.core.model.storage.key.DashPinStorageKey;\nimpo"
},
{
"path": "server/core/src/main/java/cc/blynk/server/core/model/widgets/CopyObject.java",
"chars": 183,
"preview": "package cc.blynk.server.core.model.widgets;\n\n/**\n * The Blynk Project.\n * Created by Dmitriy Dumanskiy.\n * Created on 24"
}
]
// ... and 582 more files (download for full content)
About this extraction
This page contains the full source code of the Peterkn2001/blynk-server GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 782 files (3.8 MB), approximately 1.0M tokens, and a symbol index with 4084 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.