<properties>
<encoding>UTF-8</encoding>
- <epsdk.version>1.3.0-SNAPSHOT</epsdk.version>
<springframework.version>4.2.0.RELEASE</springframework.version>
<hibernate.version>4.3.11.Final</hibernate.version>
<!-- Skip assembling the zip; assemble via mvn -Dskipassembly=false .. -->
<dependency>
<groupId>org.onap.portal.sdk</groupId>
<artifactId>epsdk-core</artifactId>
- <version>${epsdk.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.onap.portal.sdk</groupId>
<artifactId>epsdk-analytics</artifactId>
- <version>${epsdk.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.onap.portal.sdk</groupId>
<artifactId>epsdk-workflow</artifactId>
- <version>${epsdk.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.att.eelf</groupId>
List<RoleFunction> roleFunctionList = null;
String role_function_list = "";
- role_function_list = restApiRequestBuilder.getViaREST("/getAllRoleFunctions", true, loginId);
+ role_function_list = restApiRequestBuilder.getViaREST("/functions", true, loginId);
ObjectMapper mapper = new ObjectMapper();
roleFunctionList = mapper.readValue(role_function_list,
TypeFactory.defaultInstance().constructCollectionType(List.class, RoleFunction.class));
public Role getRole(String loginId, Long id) throws Exception {
ObjectMapper mapper = new ObjectMapper();
String roleString = restApiRequestBuilder.getViaREST("/role/" + id, true, loginId);
- Role role = null;
+ Role role = new Role();
role = mapper.readValue(roleString, Role.class);
if (role.getRoleFunctions() != null) {
@SuppressWarnings("unchecked")
ObjectMapper mapper = new ObjectMapper();
String role = mapper.writeValueAsString(domainRole);
try {
- restApiRequestBuilder.postViaREST("/saveRole", true, role, loginId);
+ restApiRequestBuilder.postViaREST("/role", true, role, loginId);
} catch (Exception e) {
logger.error(EELFLoggerDelegate.errorLogger, "saveRole Failed", e);
throw new Exception(e.getMessage());
public void deleteRole(String loginId, Role domainRole) throws Exception {
ObjectMapper mapper = new ObjectMapper();
String role = mapper.writeValueAsString(domainRole);
- String filter = " where active_yn = 'Y' ";
+ String roleName = domainRole.getName().replaceAll(" ", "%20");
try {
- restApiRequestBuilder.deleteViaRest("/deleteRole", true, role, filter, loginId);
+ restApiRequestBuilder.deleteViaRest("/deleteRole/"+ roleName, true, role, null, loginId);
} catch (Exception e) {
logger.error(EELFLoggerDelegate.errorLogger, "deleteRole Failed", e);
throw new Exception(e.getMessage());
}
}
-
@Override
public List<Role> getAvailableRoles(String requestedLoginId) throws Exception {
ObjectMapper mapper = new ObjectMapper();
- String roleList = restApiRequestBuilder.getViaREST("/getRoles", true, requestedLoginId);
+ String roleList = restApiRequestBuilder.getViaREST("/roles", true, requestedLoginId);
List<Role> roles = null;
roles = mapper.readValue(roleList,
TypeFactory.defaultInstance().constructCollectionType(List.class, Role.class));
@Override
public RoleFunction getRoleFunction(String requestedLoginId, String code) throws Exception {
ObjectMapper mapper = new ObjectMapper();
- String responseString = restApiRequestBuilder.getViaREST("/getRoleFunction/" + code, true, requestedLoginId);
+ String responseString = restApiRequestBuilder.getViaREST("/function/" + code, true, requestedLoginId);
RoleFunction roleFunction = new RoleFunction();
if (!responseString.isEmpty()) {
roleFunction = mapper.readValue(responseString, RoleFunction.class);
ObjectMapper mapper = new ObjectMapper();
String roleFunction = mapper.writeValueAsString(domainRoleFunction);
try{
- restApiRequestBuilder.postViaREST("/saveRoleFunction", true, roleFunction, requestedLoginId);
+ restApiRequestBuilder.postViaREST("/roleFunction", true, roleFunction, requestedLoginId);
}catch(Exception e){
- logger.error(EELFLoggerDelegate.errorLogger, "deleteDependcyRoleRecord Failed", e);
+ logger.error(EELFLoggerDelegate.errorLogger, "saveRoleFunction Failed", e);
throw new Exception(e.getMessage());
}
}
@Override
public void deleteRoleFunction(String requestedLoginId, RoleFunction domainRoleFunction) throws Exception {
+ String code = domainRoleFunction.getCode();
ObjectMapper mapper = new ObjectMapper();
String roleFunction = mapper.writeValueAsString(domainRoleFunction);
try {
- restApiRequestBuilder.deleteViaRest("/deleteRoleFunction", true, roleFunction, null, requestedLoginId);
+ restApiRequestBuilder.deleteViaRest("/roleFunction/"+ code, true, roleFunction, null, requestedLoginId);
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, "deleteRoleFunction Failed", e);
+ logger.error(EELFLoggerDelegate.errorLogger, "deleteRoleFunction Failed ", e);
throw new Exception(e.getMessage());
}
}
// Create the connection object
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
+
con.setConnectTimeout(3000);
+ // if the portal property is set then gets the timeout value from portal properties
+ if(PortalApiProperties.getProperty(PortalApiConstants.EXT_REQUEST_CONNECTION_TIMEOUT)!= null){
+ con.setConnectTimeout(Integer.parseInt(PortalApiProperties.getProperty(PortalApiConstants.EXT_REQUEST_CONNECTION_TIMEOUT)));
+ }
con.setReadTimeout(8000);
+ if(PortalApiProperties.getProperty(PortalApiConstants.EXT_REQUEST_READ_TIMEOUT)!= null){
+ con.setReadTimeout(Integer.parseInt(PortalApiProperties.getProperty(PortalApiConstants.EXT_REQUEST_READ_TIMEOUT)));
+ }
// add request header
con.setRequestProperty("uebkey", appUebKey);
// Create the connection object
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
+
con.setConnectTimeout(3000);
+ // if the portal property is set then gets the timeout value from portal properties
+ if(PortalApiProperties.getProperty(PortalApiConstants.EXT_REQUEST_CONNECTION_TIMEOUT)!= null){
+ con.setConnectTimeout(Integer.parseInt(PortalApiProperties.getProperty(PortalApiConstants.EXT_REQUEST_CONNECTION_TIMEOUT)));
+ }
con.setReadTimeout(15000);
-
+ if(PortalApiProperties.getProperty(PortalApiConstants.EXT_REQUEST_READ_TIMEOUT)!= null){
+ con.setReadTimeout(Integer.parseInt(PortalApiProperties.getProperty(PortalApiConstants.EXT_REQUEST_READ_TIMEOUT)));
+ }
+
// add request header
con.setRequestProperty("uebkey", appUebKey);
if (appUserName != null)
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
con.setConnectTimeout(3000);
+ // if the portal property is set then gets the timeout value from portal properties
+ if(PortalApiProperties.getProperty(PortalApiConstants.EXT_REQUEST_CONNECTION_TIMEOUT)!= null){
+ con.setConnectTimeout(Integer.parseInt(PortalApiProperties.getProperty(PortalApiConstants.EXT_REQUEST_CONNECTION_TIMEOUT)));
+ }
con.setReadTimeout(15000);
-
+ if(PortalApiProperties.getProperty(PortalApiConstants.EXT_REQUEST_READ_TIMEOUT)!= null){
+ con.setReadTimeout(Integer.parseInt(PortalApiProperties.getProperty(PortalApiConstants.EXT_REQUEST_READ_TIMEOUT)));
+ }
// add request header
con.setRequestProperty("uebkey", appUebKey);
if (appUserName != null)