import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.newSingleThreadContext
import kotlinx.coroutines.withContext
-import org.onap.ccsdk.cds.blueprintsprocessor.core.service.BluePrintClusterService
+import org.onap.ccsdk.cds.blueprintsprocessor.core.service.BlueprintClusterService
import org.onap.ccsdk.cds.blueprintsprocessor.core.service.ClusterLock
import org.onap.ccsdk.cds.blueprintsprocessor.core.service.ClusterMember
-import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
-import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException
+import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants
+import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintException
import org.onap.ccsdk.cds.controllerblueprints.core.MDCContext
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintDependencyService
/**
* Exposed Dependency Service by this Hazelcast Lib Module
*/
-fun BluePrintDependencyService.clusterService(): BluePrintClusterService =
+fun BlueprintDependencyService.clusterService(): BlueprintClusterService =
instance(HazelcastClusterService::class)
/** Optional Cluster Service, returns only if Cluster is enabled */
-fun BluePrintDependencyService.optionalClusterService(): BluePrintClusterService? {
- return if (BluePrintConstants.CLUSTER_ENABLED) {
- BluePrintDependencyService.clusterService()
+fun BlueprintDependencyService.optionalClusterService(): BlueprintClusterService? {
+ return if (BlueprintConstants.CLUSTER_ENABLED) {
+ BlueprintDependencyService.clusterService()
} else null
}
/** Extension to convert Hazelcast Member to Blueprints Cluster Member */
fun Member.toClusterMember(): ClusterMember {
- val memberName: String = this.getAttribute(BluePrintConstants.PROPERTY_CLUSTER_NODE_ID) ?: this.uuid.toString()
+ val memberName: String = this.getAttribute(BlueprintConstants.PROPERTY_CLUSTER_NODE_ID) ?: this.uuid.toString()
return ClusterMember(
id = this.uuid.toString(),
name = memberName,
lock.unLock()
}
} else
- throw BluePrintException("Failed to acquire lock within timeout")
+ throw BlueprintException("Failed to acquire lock within timeout")
}
}
}