This should've been about 100 commits individually. Simply figuring out
a scalable, secure, user and dev friendly design with minimal network
congestion and db calls wired my brain to not commit for some weird
reason. With that out of the way, let's get going now. Here's the list
of changes:
Externalize database properties.
A db.properties files, placed in the same level as the final .jar
overrides the default db props [used to satisfy Travis CI]. Without
providing one, the application is almost certain to fail booting.
Externalize mail properties
A POST request to '/save' containing name and mail credentials will
store the credentials in db.
Replace field injections with constructor injections
Add default mail configuration
Add classes, for Gmail and Yahoo, that return respective mail
properties
Add enums for Gmail and Yahoo
Add factory to return respective mail property class, via enum or
string
Add entity User
Add repository for User
Add service layer for User
The service layer includes the usual methods among which the
'updateEmail' method conditionally updates the mail address to use based
on key 'dbuser' in db.properties.
Add controller for user
The method to delete user is intentionally not exposed as end-point for
security purposes.
Remove classes MACAddress and IPAddress
Rename class MACToIPMap as DeviceAddress
Rename MACToIPMap's variables from 'macAddress' to 'mac' and
'ipAddress' to 'ip'
Add Lombok's data, noargs and allargs annotaions for all entities
Remove MACToIPMapController's 'sayHi' and 'add' methods and add
method 'updatePulse'
Modify MACToIPMapController's 'get' method to return an Optional
Add 'component' annotation to class HeartbeatCheck
Add 'Logger' to certain classes
Add enum type 'LDR' to SensorType
Add entity LDR
Add repository for LDR
Add service layer for LDR
Add LDRNotifier which does nothing for now
Remove LDRController's 'test' method and add method 'UpdateData'
Convert interface Sensor to a regular class with new fields mac
(which references DeviceAddress's mac as foreign key), id and value
Remove interface Sensor's existing methods 'getMacAddress()' and
'getID()'
Remove Waterflow Sensor [Will reintroduce later]
Remove WaterflowRepository
Remove WaterflowService
Remove WaterflowController
Remove WaterflowCheck
Add embeddable entity SensorTypeLookupID which references foreign key
'mac' from DeviceAddress
Add entity SensorTypeLookup which includes the embeddable
SensorTypeLookup and a SensorType field
Add repository for SensorTypeLookup
Add interface RestlessController with method 'updateBody'
Add factory to return respective controller class via enum
Add IDWrapper class to wrap the list of sensor IDs returned by a
sensor
Add SensorDataController class, which ties everything together, and
is difficult to summarize here, and I'm tired.
Whew! While this list is not an exhaustive indication of every single
modification, it covers the gist of it. Will be adding comments in code
very soon to help expand further.
And now to pray Travis builds and deploys without issues, which requires
an absolute miracle at this point!
This should've been about 100 commits individually. Simply figuring out a scalable, secure, user and dev friendly design with minimal network congestion and db calls wired my brain to not commit for some weird reason. With that out of the way, let's get going now. Here's the list of changes:
A db.properties files, placed in the same level as the final .jar overrides the default db props [used to satisfy Travis CI]. Without providing one, the application is almost certain to fail booting.
A POST request to '/save' containing name and mail credentials will store the credentials in db.
The service layer includes the usual methods among which the 'updateEmail' method conditionally updates the mail address to use based on key 'dbuser' in db.properties.
The method to delete user is intentionally not exposed as end-point for security purposes.
Whew! While this list is not an exhaustive indication of every single modification, it covers the gist of it. Will be adding comments in code very soon to help expand further.
And now to pray Travis builds and deploys without issues, which requires an absolute miracle at this point!