summaryrefslogtreecommitdiff
path: root/simulator/opendc-core
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2020-08-31 20:57:06 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2020-10-01 19:18:57 +0200
commiteedf207bf4c9b723db685e6b7a9191bef9745486 (patch)
tree3ce364af1efbadca9f33bca5d3abbace5af44b49 /simulator/opendc-core
parentdff259fa1a721df3bc2601014d5749f6e620854c (diff)
Add explicit API visibility
This change adds explicit visibility modifiers to the public interfaces and enables Kotlin 1.4's explicit API mode.
Diffstat (limited to 'simulator/opendc-core')
-rw-r--r--simulator/opendc-core/src/main/kotlin/org/opendc/core/Environment.kt2
-rw-r--r--simulator/opendc-core/src/main/kotlin/org/opendc/core/Identity.kt6
-rw-r--r--simulator/opendc-core/src/main/kotlin/org/opendc/core/Platform.kt2
-rw-r--r--simulator/opendc-core/src/main/kotlin/org/opendc/core/User.kt2
-rw-r--r--simulator/opendc-core/src/main/kotlin/org/opendc/core/Zone.kt2
-rw-r--r--simulator/opendc-core/src/main/kotlin/org/opendc/core/failure/UncorrelatedFaultInjector.kt2
-rw-r--r--simulator/opendc-core/src/main/kotlin/org/opendc/core/power/Powerable.kt2
-rw-r--r--simulator/opendc-core/src/main/kotlin/org/opendc/core/resource/TagContainer.kt4
-rw-r--r--simulator/opendc-core/src/main/kotlin/org/opendc/core/services/ServiceKey.kt4
-rw-r--r--simulator/opendc-core/src/main/kotlin/org/opendc/core/workload/Workload.kt4
10 files changed, 15 insertions, 15 deletions
diff --git a/simulator/opendc-core/src/main/kotlin/org/opendc/core/Environment.kt b/simulator/opendc-core/src/main/kotlin/org/opendc/core/Environment.kt
index 3baef092..a5055cff 100644
--- a/simulator/opendc-core/src/main/kotlin/org/opendc/core/Environment.kt
+++ b/simulator/opendc-core/src/main/kotlin/org/opendc/core/Environment.kt
@@ -31,4 +31,4 @@ package org.opendc.core
* @property description A small textual description about the environment that is being modeled.
* @property platforms The cloud platforms (such as AWS or GCE) in this environment.
*/
-data class Environment(val name: String, val description: String?, val platforms: List<Platform>)
+public data class Environment(val name: String, val description: String?, val platforms: List<Platform>)
diff --git a/simulator/opendc-core/src/main/kotlin/org/opendc/core/Identity.kt b/simulator/opendc-core/src/main/kotlin/org/opendc/core/Identity.kt
index 9c1464af..252c40f5 100644
--- a/simulator/opendc-core/src/main/kotlin/org/opendc/core/Identity.kt
+++ b/simulator/opendc-core/src/main/kotlin/org/opendc/core/Identity.kt
@@ -27,14 +27,14 @@ import java.util.*
/**
* An object that has a unique identity.
*/
-interface Identity {
+public interface Identity {
/**
* A unique, opaque, system-generated value, representing the object.
*/
- val uid: UUID
+ public val uid: UUID
/**
* A non-empty, human-readable string representing the object.
*/
- val name: String
+ public val name: String
}
diff --git a/simulator/opendc-core/src/main/kotlin/org/opendc/core/Platform.kt b/simulator/opendc-core/src/main/kotlin/org/opendc/core/Platform.kt
index 076df255..5550ffed 100644
--- a/simulator/opendc-core/src/main/kotlin/org/opendc/core/Platform.kt
+++ b/simulator/opendc-core/src/main/kotlin/org/opendc/core/Platform.kt
@@ -31,4 +31,4 @@ import java.util.*
* @property name the name of the platform.
* @property zones The availability zones available on this platform.
*/
-data class Platform(override val uid: UUID, override val name: String, val zones: List<Zone>) : Identity
+public data class Platform(override val uid: UUID, override val name: String, val zones: List<Zone>) : Identity
diff --git a/simulator/opendc-core/src/main/kotlin/org/opendc/core/User.kt b/simulator/opendc-core/src/main/kotlin/org/opendc/core/User.kt
index d4b237e7..fc542cef 100644
--- a/simulator/opendc-core/src/main/kotlin/org/opendc/core/User.kt
+++ b/simulator/opendc-core/src/main/kotlin/org/opendc/core/User.kt
@@ -25,7 +25,7 @@ package org.opendc.core
/**
* A user of the cloud network.
*/
-interface User : Identity {
+public interface User : Identity {
/**
* The name of the user.
*/
diff --git a/simulator/opendc-core/src/main/kotlin/org/opendc/core/Zone.kt b/simulator/opendc-core/src/main/kotlin/org/opendc/core/Zone.kt
index 0bca4ee5..834f6cf2 100644
--- a/simulator/opendc-core/src/main/kotlin/org/opendc/core/Zone.kt
+++ b/simulator/opendc-core/src/main/kotlin/org/opendc/core/Zone.kt
@@ -36,7 +36,7 @@ import java.util.*
* @property name The name of the zone within its platform.
* @property services The service registry containing the services of the zone.
*/
-data class Zone(
+public data class Zone(
override val uid: UUID,
override val name: String,
val services: ServiceRegistry
diff --git a/simulator/opendc-core/src/main/kotlin/org/opendc/core/failure/UncorrelatedFaultInjector.kt b/simulator/opendc-core/src/main/kotlin/org/opendc/core/failure/UncorrelatedFaultInjector.kt
index 6c019763..f64b8815 100644
--- a/simulator/opendc-core/src/main/kotlin/org/opendc/core/failure/UncorrelatedFaultInjector.kt
+++ b/simulator/opendc-core/src/main/kotlin/org/opendc/core/failure/UncorrelatedFaultInjector.kt
@@ -33,7 +33,7 @@ import kotlin.random.Random
* A [FaultInjector] that injects uncorrelated faults into the system, meaning that failures of the subsystems are
* independent.
*/
-class UncorrelatedFaultInjector(
+public class UncorrelatedFaultInjector(
private val clock: Clock,
private val alpha: Double,
private val beta: Double,
diff --git a/simulator/opendc-core/src/main/kotlin/org/opendc/core/power/Powerable.kt b/simulator/opendc-core/src/main/kotlin/org/opendc/core/power/Powerable.kt
index 4a225d9d..4b73ad92 100644
--- a/simulator/opendc-core/src/main/kotlin/org/opendc/core/power/Powerable.kt
+++ b/simulator/opendc-core/src/main/kotlin/org/opendc/core/power/Powerable.kt
@@ -33,5 +33,5 @@ public interface Powerable {
/**
* The power draw at the device's power supply in watts (W).w
*/
- val powerDraw: Flow<Double>
+ public val powerDraw: Flow<Double>
}
diff --git a/simulator/opendc-core/src/main/kotlin/org/opendc/core/resource/TagContainer.kt b/simulator/opendc-core/src/main/kotlin/org/opendc/core/resource/TagContainer.kt
index 842710d2..6a4ff102 100644
--- a/simulator/opendc-core/src/main/kotlin/org/opendc/core/resource/TagContainer.kt
+++ b/simulator/opendc-core/src/main/kotlin/org/opendc/core/resource/TagContainer.kt
@@ -25,10 +25,10 @@ package org.opendc.core.resource
/**
* An immutable map containing the tags of some resource.
*/
-typealias TagContainer = Map<String, Any>
+public typealias TagContainer = Map<String, Any>
/**
* Obtain the value of the tag with the specified [key] of type [T]. If the tag does not exist or the tag is of
* different type, `null` is returned.
*/
-inline fun <reified T : Any> TagContainer.typed(key: String): T? = this[key] as? T
+public inline fun <reified T : Any> TagContainer.typed(key: String): T? = this[key] as? T
diff --git a/simulator/opendc-core/src/main/kotlin/org/opendc/core/services/ServiceKey.kt b/simulator/opendc-core/src/main/kotlin/org/opendc/core/services/ServiceKey.kt
index 6d475f87..9078ecdd 100644
--- a/simulator/opendc-core/src/main/kotlin/org/opendc/core/services/ServiceKey.kt
+++ b/simulator/opendc-core/src/main/kotlin/org/opendc/core/services/ServiceKey.kt
@@ -30,7 +30,7 @@ import java.util.*
*
* @param T The shape of the messages the service responds to.
*/
-interface ServiceKey<T : Any> : Identity
+public interface ServiceKey<T : Any> : Identity
/**
* Helper class for constructing a [ServiceKey].
@@ -38,7 +38,7 @@ interface ServiceKey<T : Any> : Identity
* @property uid The unique identifier of the service.
* @property name The name of the service.
*/
-abstract class AbstractServiceKey<T : Any>(override val uid: UUID, override val name: String) : ServiceKey<T> {
+public abstract class AbstractServiceKey<T : Any>(override val uid: UUID, override val name: String) : ServiceKey<T> {
override fun equals(other: Any?): Boolean = other is ServiceKey<*> && uid == other.uid
override fun hashCode(): Int = uid.hashCode()
override fun toString(): String = "ServiceKey[uid=$uid, name=$name]"
diff --git a/simulator/opendc-core/src/main/kotlin/org/opendc/core/workload/Workload.kt b/simulator/opendc-core/src/main/kotlin/org/opendc/core/workload/Workload.kt
index 656020ef..f0bd1137 100644
--- a/simulator/opendc-core/src/main/kotlin/org/opendc/core/workload/Workload.kt
+++ b/simulator/opendc-core/src/main/kotlin/org/opendc/core/workload/Workload.kt
@@ -29,9 +29,9 @@ import org.opendc.core.User
* A high-level abstraction that represents the actual work that a set of compute resources perform, such
* as running an application on a machine or a whole workflow running multiple tasks on numerous machines.
*/
-interface Workload : Identity {
+public interface Workload : Identity {
/**
* The owner of this workload.
*/
- val owner: User
+ public val owner: User
}