tvaultapi/src/main/java/com/tmobile/cso/vault/api/service/SSLCertificateService.java
private boolean updatecertificateMetadataForApplicationDetails(JsonObject object, String token) {
		 TMOAppMetadataDetails tmoAppMetadataDetails = new TMOAppMetadataDetails();
			
			String appName = object.get("applicationName").getAsString();
			String certType = object.get("certType").getAsString();
			String certPath =  TVaultConstants.TMO_APP_METADATA_PATH + "/" + appName;
			List<String> certList = new ArrayList<>();
			
			boolean isCertDataUpdated = false;			
			
				tmoAppMetadataDetails.setApplicationName(object.get("applicationName").getAsString());
				tmoAppMetadataDetails.setApplicationTag(object.get("applicationTag").getAsString());
				tmoAppMetadataDetails.setApplicationOwnerEmailId(object.get("applicationOwnerEmailId")==null?null:object.get("applicationOwnerEmailId").getAsString());
				tmoAppMetadataDetails.setProjectLeadEmailId(object.get("projectLeadEmailId")!=null?object.get("projectLeadEmailId").getAsString():null);
				tmoAppMetadataDetails.setUpdateFlag(Boolean.TRUE);
				certList.add(object.get("certificateName").getAsString());				
				tmoAppMetadataDetails = deleteCertFromAppList(tmoAppMetadataDetails,appName,certType,object.get("certificateName").getAsString(),
							 token);
				if(tmoAppMetadataDetails!=null) {
			TMOAppMetadata sslCertMetadata = new TMOAppMetadata(certPath, tmoAppMetadataDetails);
	        String jsonStr = JSONUtil.getJSON(sslCertMetadata);
	        Map<String, Object> rqstParams = ControllerUtil.parseJson(jsonStr);
	        rqstParams.put("path", certPath);
	        String certDataJson = ControllerUtil.convetToJson(rqstParams);
			Response response = reqProcessor.process("/write", certDataJson, token);			

			if(response.getHttpstatus().equals(HttpStatus.NO_CONTENT)){
				 log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder().
		                    put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER)).
		                    put(LogMessage.ACTION, SSLCertificateConstants.POLICY_CREATION_TITLE).
		                    put(LogMessage.MESSAGE, "certificate name deletion success from application metadata path details ").
		                    put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).
		                    build()));
				 isCertDataUpdated = true;
			}else {
				log.error(JSONUtil.getJSON(ImmutableMap.<String, String>builder().
						put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER)).
						put(LogMessage.ACTION, SSLCertificateConstants.POLICY_CREATION_TITLE).
						put(LogMessage.MESSAGE, "certificate name deletion from application metadata path failed").
						put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).
						build()));
			}
			
				}			
			
			return isCertDataUpdated;
		}
/**
	  * Function to update the application metadata
	  * @param object
	  * @param token
	  * @return
	  */
Function to update the application metadata
@param object
@param token
@return
Function to update the application metadata @param object @param token @return
private boolean updatecertificateMetadataForApplicationDetails(JsonObject object, String token) {
		 TMOAppMetadataDetails tmoAppMetadataDetails = new TMOAppMetadataDetails();
			String appName = object.get("applicationName").getAsString();
			String certType = object.get("certType").getAsString();
			String certPath =  TVaultConstants.TMO_APP_METADATA_PATH + "/" + appName;
			List<String> certList = new ArrayList<>();
			boolean isCertDataUpdated = false;			
				tmoAppMetadataDetails.setApplicationName(object.get("applicationName").getAsString());
				tmoAppMetadataDetails.setApplicationTag(object.get("applicationTag").getAsString());
				tmoAppMetadataDetails.setApplicationOwnerEmailId(object.get("applicationOwnerEmailId")==null?null:object.get("applicationOwnerEmailId").getAsString());
				tmoAppMetadataDetails.setProjectLeadEmailId(object.get("projectLeadEmailId")!=null?object.get("projectLeadEmailId").getAsString():null);
				tmoAppMetadataDetails.setUpdateFlag(Boolean.TRUE);
				certList.add(object.get("certificateName").getAsString());				
				tmoAppMetadataDetails = deleteCertFromAppList(tmoAppMetadataDetails,appName,certType,object.get("certificateName").getAsString(),
							 token);
				if(tmoAppMetadataDetails!=null) {
			TMOAppMetadata sslCertMetadata = new TMOAppMetadata(certPath, tmoAppMetadataDetails);
	        String jsonStr = JSONUtil.getJSON(sslCertMetadata);
	        Map<String, Object> rqstParams = ControllerUtil.parseJson(jsonStr);
	        rqstParams.put("path", certPath);
	        String certDataJson = ControllerUtil.convetToJson(rqstParams);
			Response response = reqProcessor.process("/write", certDataJson, token);			
			if(response.getHttpstatus().equals(HttpStatus.NO_CONTENT)){
				 log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder().
		                    put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER)).
		                    put(LogMessage.ACTION, SSLCertificateConstants.POLICY_CREATION_TITLE).
		                    put(LogMessage.MESSAGE, "certificate name deletion success from application metadata path details ").
		                    put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).
		                    build()));
				 isCertDataUpdated = true;
			}else {
				log.error(JSONUtil.getJSON(ImmutableMap.<String, String>builder().
						put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER)).
						put(LogMessage.ACTION, SSLCertificateConstants.POLICY_CREATION_TITLE).
						put(LogMessage.MESSAGE, "certificate name deletion from application metadata path failed").
						put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).
						build()));
			}
				}			
			return isCertDataUpdated;
		}
private boolean updatecertificateMetadataForApplicationDetails ( JsonObject object , String token ) { TMOAppMetadataDetails tmoAppMetadataDetails = new TMOAppMetadataDetails ( ) ; String appName = object . get ( "applicationName" ) . getAsString ( ) ; String certType = object . get ( "certType" ) . getAsString ( ) ; String certPath = TVaultConstants . TMO_APP_METADATA_PATH + "/" + appName ; List < String > certList = new ArrayList < > ( ) ; boolean isCertDataUpdated = false ; tmoAppMetadataDetails . setApplicationName ( object . get ( "applicationName" ) . getAsString ( ) ) ; tmoAppMetadataDetails . setApplicationTag ( object . get ( "applicationTag" ) . getAsString ( ) ) ; tmoAppMetadataDetails . setApplicationOwnerEmailId ( object . get ( "applicationOwnerEmailId" ) == null ? null : object . get ( "applicationOwnerEmailId" ) . getAsString ( ) ) ; tmoAppMetadataDetails . setProjectLeadEmailId ( object . get ( "projectLeadEmailId" ) != null ? object . get ( "projectLeadEmailId" ) . getAsString ( ) : null ) ; tmoAppMetadataDetails . setUpdateFlag ( Boolean . TRUE ) ; certList . add ( object . get ( "certificateName" ) . getAsString ( ) ) ; tmoAppMetadataDetails = deleteCertFromAppList ( tmoAppMetadataDetails , appName , certType , object . get ( "certificateName" ) . getAsString ( ) , token ) ; if ( tmoAppMetadataDetails != null ) { TMOAppMetadata sslCertMetadata = new TMOAppMetadata ( certPath , tmoAppMetadataDetails ) ; String jsonStr = JSONUtil . getJSON ( sslCertMetadata ) ; Map < String , Object > rqstParams = ControllerUtil . parseJson ( jsonStr ) ; rqstParams . put ( "path" , certPath ) ; String certDataJson = ControllerUtil . convetToJson ( rqstParams ) ; Response response = reqProcessor . process ( "/write" , certDataJson , token ) ; if ( response . getHttpstatus ( ) . equals ( HttpStatus . NO_CONTENT ) ) { log . debug ( JSONUtil . getJSON ( ImmutableMap . < String , String > builder ( ) . put ( LogMessage . USER , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . USER ) ) . put ( LogMessage . ACTION , SSLCertificateConstants . POLICY_CREATION_TITLE ) . put ( LogMessage . MESSAGE , "certificate name deletion success from application metadata path details " ) . put ( LogMessage . APIURL , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . APIURL ) ) . build ( ) ) ) ; isCertDataUpdated = true ; } else { log . error ( JSONUtil . getJSON ( ImmutableMap . < String , String > builder ( ) . put ( LogMessage . USER , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . USER ) ) . put ( LogMessage . ACTION , SSLCertificateConstants . POLICY_CREATION_TITLE ) . put ( LogMessage . MESSAGE , "certificate name deletion from application metadata path failed" ) . put ( LogMessage . APIURL , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . APIURL ) ) . build ( ) ) ) ; } } return isCertDataUpdated ; }
Function to update the application metadata
 @param object
 @param token
 @return
Function to update the application metadata @param object @param token @return