tvaultapi/src/main/java/com/tmobile/cso/vault/api/service/SSLCertificateService.java
private boolean certificateMetadataForPoliciesCreation(SSLCertificateRequest sslCertificateRequest, String token,
			String certPath) {
		SSLCertificateMetadataDetails sslCertificateMetadataDetails = new SSLCertificateMetadataDetails();

    	sslCertificateMetadataDetails.setApplicationName(sslCertificateRequest.getAppName());
		sslCertificateMetadataDetails.setCertificateName(
				sslCertificateRequest.getCertificateName());
    	sslCertificateMetadataDetails.setCertType(sslCertificateRequest.getCertType());
    	sslCertificateMetadataDetails.setCertOwnerNtid(sslCertificateRequest.getCertOwnerNtid());

    	SSLCertMetadata sslCertMetadata = new SSLCertMetadata(certPath, sslCertificateMetadataDetails);
        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);

		boolean isCertDataUpdated = false;

		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, "SSL certificate metadata creation success for policy creation").
	                    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, "SSL certificate metadata creation failed for policy creation").
					put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).
					build()));
		}
		return isCertDataUpdated;
	}
/**
	 * Method to create certificate metadata in sslcerts/externalcerts mount
	 * @param sslCertificateRequest
	 * @param token
	 * @param certPath
	 * @return
	 */
Method to create certificate metadata in sslcerts/externalcerts mount
@param sslCertificateRequest
@param token
@param certPath
@return
Method to create certificate metadata in sslcerts / externalcerts mount @param sslCertificateRequest @param token @param certPath @return
private boolean certificateMetadataForPoliciesCreation(SSLCertificateRequest sslCertificateRequest, String token,
			String certPath) {
		SSLCertificateMetadataDetails sslCertificateMetadataDetails = new SSLCertificateMetadataDetails();
    	sslCertificateMetadataDetails.setApplicationName(sslCertificateRequest.getAppName());
		sslCertificateMetadataDetails.setCertificateName(
				sslCertificateRequest.getCertificateName());
    	sslCertificateMetadataDetails.setCertType(sslCertificateRequest.getCertType());
    	sslCertificateMetadataDetails.setCertOwnerNtid(sslCertificateRequest.getCertOwnerNtid());
    	SSLCertMetadata sslCertMetadata = new SSLCertMetadata(certPath, sslCertificateMetadataDetails);
        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);
		boolean isCertDataUpdated = false;
		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, "SSL certificate metadata creation success for policy creation").
	                    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, "SSL certificate metadata creation failed for policy creation").
					put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).
					build()));
		}
		return isCertDataUpdated;
	}
private boolean certificateMetadataForPoliciesCreation ( SSLCertificateRequest sslCertificateRequest , String token , String certPath ) { SSLCertificateMetadataDetails sslCertificateMetadataDetails = new SSLCertificateMetadataDetails ( ) ; sslCertificateMetadataDetails . setApplicationName ( sslCertificateRequest . getAppName ( ) ) ; sslCertificateMetadataDetails . setCertificateName ( sslCertificateRequest . getCertificateName ( ) ) ; sslCertificateMetadataDetails . setCertType ( sslCertificateRequest . getCertType ( ) ) ; sslCertificateMetadataDetails . setCertOwnerNtid ( sslCertificateRequest . getCertOwnerNtid ( ) ) ; SSLCertMetadata sslCertMetadata = new SSLCertMetadata ( certPath , sslCertificateMetadataDetails ) ; 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 ) ; boolean isCertDataUpdated = false ; 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 , "SSL certificate metadata creation success for policy creation" ) . 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 , "SSL certificate metadata creation failed for policy creation" ) . put ( LogMessage . APIURL , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . APIURL ) ) . build ( ) ) ) ; } return isCertDataUpdated ; }
Method to create certificate metadata in sslcerts/externalcerts mount
 @param sslCertificateRequest
 @param token
 @param certPath
 @return
Method to create certificate metadata in sslcerts / externalcerts mount @param sslCertificateRequest @param token @param certPath @return