Skip to content

Commit

Permalink
prime-1.10.2 - Made neo4j protocol configurable.
Browse files Browse the repository at this point in the history
  • Loading branch information
vihangpatil authored Aug 13, 2018
2 parents bbe6ad6 + db5eec9 commit f523668
Show file tree
Hide file tree
Showing 27 changed files with 40 additions and 24 deletions.
2 changes: 1 addition & 1 deletion acceptance-tests/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "org.jetbrains.kotlin.jvm" version "1.2.51"
id "org.jetbrains.kotlin.jvm" version "1.2.60"
id "application"
id "com.github.johnrengelman.shadow" version "2.0.4"
}
Expand Down
2 changes: 1 addition & 1 deletion admin-api/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "org.jetbrains.kotlin.jvm" version "1.2.51"
id "org.jetbrains.kotlin.jvm" version "1.2.60"
id "java-library"
}

Expand Down
2 changes: 1 addition & 1 deletion analytics/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "org.jetbrains.kotlin.jvm" version "1.2.51"
id "org.jetbrains.kotlin.jvm" version "1.2.60"
id "application"
id "com.github.johnrengelman.shadow" version "2.0.4"
id "idea"
Expand Down
2 changes: 1 addition & 1 deletion app-notifier/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "org.jetbrains.kotlin.jvm" version "1.2.51"
id "org.jetbrains.kotlin.jvm" version "1.2.60"
id "java-library"
}

Expand Down
2 changes: 1 addition & 1 deletion auth-server/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "org.jetbrains.kotlin.jvm" version "1.2.51"
id "org.jetbrains.kotlin.jvm" version "1.2.60"
id "application"
id "com.github.johnrengelman.shadow" version "2.0.4"
id "idea"
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ subprojects {
options.encoding = 'UTF-8'
}
ext {
kotlinVersion = "1.2.51"
kotlinVersion = "1.2.60"
dropwizardVersion = "1.3.5"
googleCloudVersion = "1.35.0"
jacksonVersion = "2.9.6"
Expand Down
2 changes: 1 addition & 1 deletion client-api/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "org.jetbrains.kotlin.jvm" version "1.2.51"
id "org.jetbrains.kotlin.jvm" version "1.2.60"
id "java-library"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,19 @@ class SubscriberDAOImpl(private val storage: ClientDataSource, private val ocsSu
}
try {
profile.referralId = profile.email
storage.addSubscriber(profile, referredBy)
val created = storage.addSubscriber(profile, referredBy)
.map { ApiError("Failed to create profile. ${it.message}") }

if(created.isEmpty()) {
return getProfile(subscriberId)
}

return Either.left(created.get())

} catch (e: Exception) {
logger.error("Failed to create profile", e)
return Either.left(ApiError("Failed to create profile"))
}

return getProfile(subscriberId)
}

override fun storeApplicationToken(msisdn: String, applicationToken: ApplicationToken): Either<ApiError, ApplicationToken> {
Expand Down
2 changes: 1 addition & 1 deletion diameter-stack/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "org.jetbrains.kotlin.jvm" version "1.2.51"
id "org.jetbrains.kotlin.jvm" version "1.2.60"
id "java-library"
id "signing"
id "maven"
Expand Down
2 changes: 1 addition & 1 deletion diameter-test/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "org.jetbrains.kotlin.jvm" version "1.2.51"
id "org.jetbrains.kotlin.jvm" version "1.2.60"
id "java-library"
id "signing"
id "maven"
Expand Down
2 changes: 1 addition & 1 deletion ext-auth-provider/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "org.jetbrains.kotlin.jvm" version "1.2.51"
id "org.jetbrains.kotlin.jvm" version "1.2.60"
id "application"
id "com.github.johnrengelman.shadow" version "2.0.4"
}
Expand Down
2 changes: 1 addition & 1 deletion firebase-store/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "org.jetbrains.kotlin.jvm" version "1.2.51"
id "org.jetbrains.kotlin.jvm" version "1.2.60"
id "java-library"
}

Expand Down
2 changes: 1 addition & 1 deletion model/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "org.jetbrains.kotlin.jvm" version "1.2.51"
id "org.jetbrains.kotlin.jvm" version "1.2.60"
id "java-library"
}

Expand Down
2 changes: 1 addition & 1 deletion neo4j-store/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "org.jetbrains.kotlin.jvm" version "1.2.51"
id "org.jetbrains.kotlin.jvm" version "1.2.60"
id "java-library"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ fun initDatabase() {

class Config {
lateinit var host: String
lateinit var protocol: String
}

object ConfigRegistry {
Expand All @@ -74,7 +75,7 @@ object Neo4jClient : Managed {
.withConnectionTimeout(10, SECONDS)
.toConfig()
driver = GraphDatabase.driver(
URI("bolt://${ConfigRegistry.config.host}:7687"),
URI("${ConfigRegistry.config.protocol}://${ConfigRegistry.config.host}:7687"),
AuthTokens.none(),
config) ?: throw Exception("Unable to get Neo4j client driver instance")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ class GraphStoreTest {
fun start() {
ConfigRegistry.config = Config()
ConfigRegistry.config.host = "0.0.0.0"
ConfigRegistry.config.protocol = "bolt"
Neo4jClient.start()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ class SchemaTest {
fun start() {
ConfigRegistry.config = Config()
ConfigRegistry.config.host = "0.0.0.0"
ConfigRegistry.config.protocol = "bolt"
Neo4jClient.start()
}

Expand Down
2 changes: 1 addition & 1 deletion ocs/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "org.jetbrains.kotlin.jvm" version "1.2.51"
id "org.jetbrains.kotlin.jvm" version "1.2.60"
id "java-library"
}

Expand Down
2 changes: 1 addition & 1 deletion prime-api/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "org.jetbrains.kotlin.jvm" version "1.2.51"
id "org.jetbrains.kotlin.jvm" version "1.2.60"
id "java-library"
}

Expand Down
2 changes: 1 addition & 1 deletion prime-client-api/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "org.jetbrains.kotlin.jvm" version "1.2.51"
id "org.jetbrains.kotlin.jvm" version "1.2.60"
id 'java-library'
id 'org.hidetake.swagger.generator' version '2.12.0'
id "idea"
Expand Down
4 changes: 2 additions & 2 deletions prime/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "org.jetbrains.kotlin.jvm" version "1.2.51"
id "org.jetbrains.kotlin.jvm" version "1.2.60"
id "application"
id "com.github.johnrengelman.shadow" version "2.0.4"
id "idea"
Expand All @@ -18,7 +18,7 @@ sourceSets {
}
}

version = "1.10.1"
version = "1.10.2"

repositories {
maven {
Expand Down
1 change: 1 addition & 0 deletions prime/config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ modules:
- type: neo4j
config:
host: neo4j
protocol: bolt+routing
- type: ocs
config:
projectId: pantel-2decb
Expand Down
1 change: 1 addition & 0 deletions prime/config/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ modules:
- type: neo4j
config:
host: neo4j
protocol: bolt
- type: ocs
config:
projectId: pantel-2decb
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,10 @@ class OcsTest {
@JvmStatic
@Throws(IOException::class)
fun setUp() {
ConfigRegistry.config = Config().apply { this.host = "0.0.0.0" }
ConfigRegistry.config = Config().apply {
this.host = "0.0.0.0"
this.protocol = "bolt"
}
initFirebaseConfigRegistry()

Neo4jClient.start()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ class Neo4jStorageTest {

val config = Config()
config.host = "0.0.0.0"
ConfigRegistry.config.protocol = "bolt"
ConfigRegistry.config = config

Neo4jClient.start()
Expand Down
1 change: 1 addition & 0 deletions prime/src/integration-tests/resources/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ modules:
- type: neo4j
config:
host: 0.0.0.0
protocol: bolt
- type: ocs
config:
projectId: pantel-2decb
Expand Down
2 changes: 1 addition & 1 deletion pseudonym-server/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "org.jetbrains.kotlin.jvm" version "1.2.51"
id "org.jetbrains.kotlin.jvm" version "1.2.60"
id "application"
id "com.github.johnrengelman.shadow" version "2.0.4"
id "idea"
Expand Down

0 comments on commit f523668

Please sign in to comment.