Skip to content

Commit

Permalink
uplifted shared version to 0.3.3 to support versioning functionality (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
xdurvak authored Jul 24, 2017
1 parent 6fa9d3f commit 13cec1b
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 62 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## 0.8.1
- Added copyright headers to the source code.
- Uplifted remrem-shared version to 0.3.3 to get the versions of generate and all loaded protocols.

## 0.8.0
- Updated remrem-shared version to 0.3.2 to support base64 encryption functionality for Ldap manager password.
Expand Down
28 changes: 14 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,19 @@ subprojects {
maven { url "https://jitpack.io" }
}

dependencies {
//Injectable Message Library and its Implementation
compile ('com.github.Ericsson:eiffel-remrem-shared:0.3.2')
compile ('com.github.Ericsson:eiffel-remrem-semantics:0.2.3')
compile ('com.github.Ericsson:eiffel-remrem-protocol-interface:0.0.1')
//Authentication
compile("org.springframework.boot:spring-boot-starter-security:$sprintBootVersion")
compile("org.springframework.security:spring-security-ldap:4.1.3.RELEASE")
compile("org.apache.directory.server:apacheds-server-jndi:1.5.5")
// Test framework
testCompile 'junit:junit:4.12'
testCompile 'org.assertj:assertj-core:3.4.1'
testCompile("org.springframework.boot:spring-boot-starter-test:$sprintBootVersion")
dependencies {
//Injectable Message Library and its Implementation
compile ('com.github.Ericsson:eiffel-remrem-shared:0.3.3')
compile ('com.github.Ericsson:eiffel-remrem-semantics:0.2.5')
compile ('com.github.Ericsson:eiffel-remrem-protocol-interface:0.0.1')

//Authentication
compile("org.springframework.boot:spring-boot-starter-security:$sprintBootVersion")
compile("org.springframework.security:spring-security-ldap:4.1.3.RELEASE")
compile("org.apache.directory.server:apacheds-server-jndi:1.5.5")
// Test framework
testCompile 'junit:junit:4.12'
testCompile 'org.assertj:assertj-core:3.4.1'
testCompile("org.springframework.boot:spring-boot-starter-test:$sprintBootVersion")
}
}
6 changes: 3 additions & 3 deletions cli/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ apply plugin: 'eclipse'
jar{
baseName = 'generate-cli'
manifest {
attributes(
'Main-Class': 'com.ericsson.eiffel.remrem.generate.cli.CLI'
)
attributes('Main-Class': 'com.ericsson.eiffel.remrem.generate.cli.CLI')
attributes('remremVersionKey': 'serviceVersion')
attributes('serviceVersion': version)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public void testWrongMessageTypeFail() throws Exception {
CLIOptions.parse(args);
cli.main(args);
String message = bytes.toString();
boolean conditionTrue = message.contains("Unknown message type requested");
boolean conditionTrue = message.contains("Unknown event type requested");
assertTrue(conditionTrue);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public static Options createCLIOptions() {
contentGroup.addOption(new Option("json", "json_content", true, "json content"));
options.addOptionGroup(contentGroup);

options.addOption("lv", "list_versions", false, "list the version and all loaded protocols");
options.addOption("v", "list_versions", false, "lists the versions of generate and all loaded protocols");
return options;
}

Expand Down Expand Up @@ -125,19 +125,19 @@ public static void afterParseChecks() throws MissingOptionException{
if (commandLine.hasOption("h")) {
System.out.println("You passed help flag.");
help(0);
} else if (commandLine.hasOption("lv")) {
} else if (commandLine.hasOption("v")) {
printVersions();
} else {
checkRequiredOptions();
}
}

/**
* Lists the version and all loaded protocols
* Lists the versions of generate and all loaded protocols
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
private static void printVersions() {
Map versions = VersionService.getMessagingVersions();
Map versions = new VersionService().getMessagingVersions();
Map<String, String> endpointVersions = (Map<String, String>) versions.get("endpointVersions");
Map<String, String> serviceVersion = (Map<String, String>) versions.get("serviceVersion");

Expand Down
6 changes: 3 additions & 3 deletions service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ apply plugin: 'war'
war {
baseName = 'generate-service'
manifest {
attributes(
'Main-Class': 'com.ericsson.eiffel.remrem.generate.App'
)
attributes('Main-Class': 'com.ericsson.eiffel.remrem.generate.App')
attributes('remremVersionKey': 'serviceVersion')
attributes('serviceVersion': version)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package com.ericsson.eiffel.remrem.generate.controller;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
Expand All @@ -28,6 +29,7 @@

import com.ericsson.eiffel.remrem.generate.constants.RemremGenerateServiceConstants;
import com.ericsson.eiffel.remrem.protocol.MsgService;
import com.ericsson.eiffel.remrem.shared.VersionService;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;;
Expand Down Expand Up @@ -76,6 +78,17 @@ public ResponseEntity<?> generate(@PathVariable String mp, @RequestParam("msgTyp
return new ResponseEntity<>(null,HttpStatus.INTERNAL_SERVER_ERROR);
}
}

/**
* this method is used to display the versions of generate and all loaded protocols.
*
* @return this method returns a json with version details.
*/
@RequestMapping(value = "/versions", method = RequestMethod.GET)
public JsonElement getVersions() {
Map<String, Map<String, String>> versions = new VersionService().getMessagingVersions();
return parser.parse(versions.toString());
}


private MsgService getMessageService(String messageProtocol) {
Expand Down

This file was deleted.

0 comments on commit 13cec1b

Please sign in to comment.