From 329f956f3d612d07feb8429de91bdfbc3704fb02 Mon Sep 17 00:00:00 2001 From: manoj Date: Fri, 23 Jan 2015 18:19:21 +0530 Subject: [PATCH] License Management --- .../src/repository/resources/rxts/license.rxt | 15 ++++++++++++--- .../cdmserver/mobileservices/android/Device.java | 4 +--- .../impl/CertificateEnrollmentServiceImpl.java | 15 +++++++++------ 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/product/modules/distribution/src/repository/resources/rxts/license.rxt b/product/modules/distribution/src/repository/resources/rxts/license.rxt index 72f5c2618..2fc84c6db 100644 --- a/product/modules/distribution/src/repository/resources/rxts/license.rxt +++ b/product/modules/distribution/src/repository/resources/rxts/license.rxt @@ -1,16 +1,19 @@ - /license/@{overview_provider}/@{overview_name}/@{overview_version} + /license/@{overview_provider}/@{overview_name}/@{overview_language}/@{overview_version} overview_name - + + + + @@ -24,11 +27,17 @@ Name + + Language + Version - Createdtime + Validity From + + + Validity To License diff --git a/product/modules/mobileservices/agents/android/jax-rs/src/main/java/org/wso2/cdmserver/mobileservices/android/Device.java b/product/modules/mobileservices/agents/android/jax-rs/src/main/java/org/wso2/cdmserver/mobileservices/android/Device.java index 0a9e01ffc..20af913ff 100644 --- a/product/modules/mobileservices/agents/android/jax-rs/src/main/java/org/wso2/cdmserver/mobileservices/android/Device.java +++ b/product/modules/mobileservices/agents/android/jax-rs/src/main/java/org/wso2/cdmserver/mobileservices/android/Device.java @@ -131,10 +131,9 @@ public class Device { } @GET - @Path("/device/license") + @Path("/license") @Produces("text/plain") public String getLicense() { - //TODO: need to implement fetch license from core License license = null; try { try { @@ -147,7 +146,6 @@ public class Device { }catch(DeviceManagementServiceException deviceMgtEx){ deviceMgtEx.printStackTrace(); } - return license.getLicenseText(); } } diff --git a/product/modules/mobileservices/agents/windows/jax-rs/src/main/java/cdm/api/windows/wstep/impl/CertificateEnrollmentServiceImpl.java b/product/modules/mobileservices/agents/windows/jax-rs/src/main/java/cdm/api/windows/wstep/impl/CertificateEnrollmentServiceImpl.java index 32f8c35dc..ca41e7394 100644 --- a/product/modules/mobileservices/agents/windows/jax-rs/src/main/java/cdm/api/windows/wstep/impl/CertificateEnrollmentServiceImpl.java +++ b/product/modules/mobileservices/agents/windows/jax-rs/src/main/java/cdm/api/windows/wstep/impl/CertificateEnrollmentServiceImpl.java @@ -69,7 +69,8 @@ public class CertificateEnrollmentServiceImpl implements CertificateEnrollmentSe String wapProvisioningXmlFile; DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance(); - @Override public void RequestSecurityToken(String TokenType, String RequestType, + //@Override + public void RequestSecurityToken(String TokenType, String RequestType, String BinarySecurityToken, AdditionalContext AdditionalContext, Holder response) { @@ -109,18 +110,20 @@ public class CertificateEnrollmentServiceImpl implements CertificateEnrollmentSe NodeList wapParm = dDoc.getElementsByTagName("parm"); ///////// - wapParm.item(0).getParentNode().getAttributes().getNamedItem("type").setTextContent(String.valueOf( + /* wapParm.item(0).getParentNode().getAttributes().getNamedItem("type").setTextContent(String.valueOf( DigestUtils.sha1Hex(rooCACertificate.getEncoded()))); - ///////// + */ ///////// NamedNodeMap rootCertAttributes = wapParm.item(0).getAttributes(); Node b64Encoded = rootCertAttributes.getNamedItem("value"); rootCertEncodedString=rootCertEncodedString.replaceAll("\n",""); b64Encoded.setTextContent(rootCertEncodedString); System.out.println("COPY_ROOT_CERT:"+rootCertEncodedString); - ///////// - wapParm.item(1).getParentNode().getAttributes().getNamedItem("type").setTextContent(String.valueOf(DigestUtils.sha1Hex(signedCert.getEncoded()))); - ///////// + ///////// + ///////// +/* + wapParm.item(1).getParentNode().getAttributes().getNamedItem("type").setTextContent(String.valueOf(DigestUtils.sha1Hex(signedCert.getEncoded()))); +*/