-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from sensiflow/dev
1.1.0
- Loading branch information
Showing
55 changed files
with
1,580 additions
and
687 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
src/main/kotlin/com/isel/sensiflow/amqp/DeleteDeviceMessage.kt
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
src/main/kotlin/com/isel/sensiflow/amqp/DeviceStateResponseMessage.kt
This file was deleted.
Oops, something went wrong.
45 changes: 45 additions & 0 deletions
45
src/main/kotlin/com/isel/sensiflow/amqp/ProcessingAction.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package com.isel.sensiflow.amqp | ||
|
||
import com.isel.sensiflow.model.entities.DeviceProcessingState | ||
|
||
/** | ||
* Represents a possible action to be performed on a device. | ||
*/ | ||
enum class ProcessingAction { | ||
START, | ||
RESUME, | ||
STOP, | ||
REMOVE, | ||
PAUSE; | ||
|
||
companion object { | ||
|
||
fun fromString(value: String): ProcessingAction? { | ||
return try { | ||
ProcessingAction.valueOf(value.uppercase()) | ||
} catch (e: IllegalArgumentException) { | ||
null | ||
} | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* Returns the action that should be performed on the device to transition to the receiver state. | ||
*/ | ||
val DeviceProcessingState.action: ProcessingAction get() = when (this) { | ||
DeviceProcessingState.ACTIVE -> ProcessingAction.START | ||
DeviceProcessingState.PAUSED -> ProcessingAction.PAUSE | ||
DeviceProcessingState.INACTIVE -> ProcessingAction.STOP | ||
} | ||
|
||
/** | ||
* Returns the state that the device should be in after performing the receiver action. | ||
*/ | ||
val ProcessingAction.state: DeviceProcessingState get() = when (this) { | ||
ProcessingAction.START -> DeviceProcessingState.ACTIVE | ||
ProcessingAction.PAUSE -> DeviceProcessingState.PAUSED | ||
ProcessingAction.STOP -> DeviceProcessingState.INACTIVE | ||
ProcessingAction.REMOVE -> DeviceProcessingState.INACTIVE | ||
ProcessingAction.RESUME -> DeviceProcessingState.ACTIVE | ||
} |
20 changes: 20 additions & 0 deletions
20
src/main/kotlin/com/isel/sensiflow/amqp/SchedulerNotification.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.isel.sensiflow.amqp | ||
|
||
/** | ||
* Represents a possible action to be performed by the Instance Manager Scheduler on processor instances. | ||
*/ | ||
enum class SchedulerNotification { | ||
UPDATED_INSTANCE, | ||
REMOVED_INSTANCE; | ||
|
||
companion object { | ||
|
||
fun fromString(value: String): SchedulerNotification? { | ||
return try { | ||
SchedulerNotification.valueOf(value.uppercase()) | ||
} catch (e: IllegalArgumentException) { | ||
null | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.