tvaultapi/src/main/java/com/tmobile/cso/vault/api/service/SSLCertificateService.java
public ResponseEntity<String> onboardCertificate(SSLCertificateRequest sslCertificateRequest,UserDetails userDetails, int containerId, String tagsOwner) {
		    	
		    	if(StringUtils.isEmpty(sslCertificateRequest.getAppName())) {
		    		log.error(JSONUtil.getJSON(ImmutableMap.<String, String>builder().
		 					put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER)).
		 					put(LogMessage.ACTION, SSLCertificateConstants.ONBOARD_SSL_CERTIFICATE).
		 					put(LogMessage.MESSAGE, String.format("[%s] - Certificate onboard Failed. Application Name is not available. ", sslCertificateRequest.getCertificateName())).
		 					put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).
		 					build()));
		    		 return ResponseEntity.status(HttpStatus.BAD_REQUEST)
		    					.body(ERRORS + "Application name unavailable. " + "\"]}");
		    	}
		    	
		    	try {
		    		ResponseEntity<String> metadataResponse = createCertMetadataAndPolicy(sslCertificateRequest,userDetails,containerId, tagsOwner);
		    		if(!HttpStatus.OK.equals(metadataResponse.getStatusCode())){
		    			log.error(JSONUtil.getJSON(ImmutableMap.<String, String>builder().
		    					put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER)).
		    					put(LogMessage.ACTION, SSLCertificateConstants.ONBOARD_SSL_CERTIFICATE).
		    					put(LogMessage.MESSAGE, String.format("[%s] - Certficate metadata creation failed.  ", sslCertificateRequest.getCertificateName())).
		    					put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).
		    					build()));
		    			return ResponseEntity.status(HttpStatus.FORBIDDEN)
		    					.body(ERRORS + "Certficate metadata creation failed. " + "\"]}");
		    		}
		    		else if(HttpStatus.OK.equals(metadataResponse.getStatusCode())) {
		    			log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder().
		    					put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER)).
		    					put(LogMessage.ACTION, SSLCertificateConstants.ONBOARD_SSL_CERTIFICATE).
		    					put(LogMessage.MESSAGE, String.format("[%s] - Certficate onboarding is successfully - completed.  ", sslCertificateRequest.getCertificateName())).
		    					put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).
		    					build()));
		    			
		    		}
				} catch (Exception tex) {
					log.error(JSONUtil.getJSON(ImmutableMap.<String, String>builder().
		                    put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER)).
		                    put(LogMessage.ACTION, String.format(" Onboardcertificate " +
		                                    "Exception = [%s] =  Message [%s] = certificate name = [%s]",
		                            Arrays.toString(tex.getStackTrace()), tex.getMessage(),sslCertificateRequest.getCertificateName())).build()));
					return ResponseEntity.status(HttpStatus.FORBIDDEN)
							.body(ERRORS + "Certificate onboard failed. " + "\"]}");
				}
		    	return ResponseEntity.status(HttpStatus.OK)
						.body(MESSAGES + "Certficate onboarding is successfully completed. " + "\"]}");
		    }
/**
		     * Method to Create policies and metadata for the given certificate
		     * @param certObject
		     */
Method to Create policies and metadata for the given certificate
@param certObject
Method to Create policies and metadata for the given certificate @param certObject
public ResponseEntity<String> onboardCertificate(SSLCertificateRequest sslCertificateRequest,UserDetails userDetails, int containerId, String tagsOwner) {
		    	if(StringUtils.isEmpty(sslCertificateRequest.getAppName())) {
		    		log.error(JSONUtil.getJSON(ImmutableMap.<String, String>builder().
		 					put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER)).
		 					put(LogMessage.ACTION, SSLCertificateConstants.ONBOARD_SSL_CERTIFICATE).
		 					put(LogMessage.MESSAGE, String.format("[%s] - Certificate onboard Failed. Application Name is not available. ", sslCertificateRequest.getCertificateName())).
		 					put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).
		 					build()));
		    		 return ResponseEntity.status(HttpStatus.BAD_REQUEST)
		    					.body(ERRORS + "Application name unavailable. " + "\"]}");
		    	}
		    	try {
		    		ResponseEntity<String> metadataResponse = createCertMetadataAndPolicy(sslCertificateRequest,userDetails,containerId, tagsOwner);
		    		if(!HttpStatus.OK.equals(metadataResponse.getStatusCode())){
		    			log.error(JSONUtil.getJSON(ImmutableMap.<String, String>builder().
		    					put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER)).
		    					put(LogMessage.ACTION, SSLCertificateConstants.ONBOARD_SSL_CERTIFICATE).
		    					put(LogMessage.MESSAGE, String.format("[%s] - Certficate metadata creation failed.  ", sslCertificateRequest.getCertificateName())).
		    					put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).
		    					build()));
		    			return ResponseEntity.status(HttpStatus.FORBIDDEN)
		    					.body(ERRORS + "Certficate metadata creation failed. " + "\"]}");
		    		}
		    		else if(HttpStatus.OK.equals(metadataResponse.getStatusCode())) {
		    			log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder().
		    					put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER)).
		    					put(LogMessage.ACTION, SSLCertificateConstants.ONBOARD_SSL_CERTIFICATE).
		    					put(LogMessage.MESSAGE, String.format("[%s] - Certficate onboarding is successfully - completed.  ", sslCertificateRequest.getCertificateName())).
		    					put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).
		    					build()));
		    		}
				} catch (Exception tex) {
					log.error(JSONUtil.getJSON(ImmutableMap.<String, String>builder().
		                    put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER)).
		                    put(LogMessage.ACTION, String.format(" Onboardcertificate " +
		                                    "Exception = [%s] =  Message [%s] = certificate name = [%s]",
		                            Arrays.toString(tex.getStackTrace()), tex.getMessage(),sslCertificateRequest.getCertificateName())).build()));
					return ResponseEntity.status(HttpStatus.FORBIDDEN)
							.body(ERRORS + "Certificate onboard failed. " + "\"]}");
				}
		    	return ResponseEntity.status(HttpStatus.OK)
						.body(MESSAGES + "Certficate onboarding is successfully completed. " + "\"]}");
		    }
public ResponseEntity < String > onboardCertificate ( SSLCertificateRequest sslCertificateRequest , UserDetails userDetails , int containerId , String tagsOwner ) { if ( StringUtils . isEmpty ( sslCertificateRequest . getAppName ( ) ) ) { log . error ( JSONUtil . getJSON ( ImmutableMap . < String , String > builder ( ) . put ( LogMessage . USER , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . USER ) ) . put ( LogMessage . ACTION , SSLCertificateConstants . ONBOARD_SSL_CERTIFICATE ) . put ( LogMessage . MESSAGE , String . format ( "[%s] - Certificate onboard Failed. Application Name is not available. " , sslCertificateRequest . getCertificateName ( ) ) ) . put ( LogMessage . APIURL , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . APIURL ) ) . build ( ) ) ) ; return ResponseEntity . status ( HttpStatus . BAD_REQUEST ) . body ( ERRORS + "Application name unavailable. " + "\"]}" ) ; } try { ResponseEntity < String > metadataResponse = createCertMetadataAndPolicy ( sslCertificateRequest , userDetails , containerId , tagsOwner ) ; if ( ! HttpStatus . OK . equals ( metadataResponse . getStatusCode ( ) ) ) { log . error ( JSONUtil . getJSON ( ImmutableMap . < String , String > builder ( ) . put ( LogMessage . USER , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . USER ) ) . put ( LogMessage . ACTION , SSLCertificateConstants . ONBOARD_SSL_CERTIFICATE ) . put ( LogMessage . MESSAGE , String . format ( "[%s] - Certficate metadata creation failed.  " , sslCertificateRequest . getCertificateName ( ) ) ) . put ( LogMessage . APIURL , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . APIURL ) ) . build ( ) ) ) ; return ResponseEntity . status ( HttpStatus . FORBIDDEN ) . body ( ERRORS + "Certficate metadata creation failed. " + "\"]}" ) ; } else if ( HttpStatus . OK . equals ( metadataResponse . getStatusCode ( ) ) ) { log . debug ( JSONUtil . getJSON ( ImmutableMap . < String , String > builder ( ) . put ( LogMessage . USER , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . USER ) ) . put ( LogMessage . ACTION , SSLCertificateConstants . ONBOARD_SSL_CERTIFICATE ) . put ( LogMessage . MESSAGE , String . format ( "[%s] - Certficate onboarding is successfully - completed.  " , sslCertificateRequest . getCertificateName ( ) ) ) . put ( LogMessage . APIURL , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . APIURL ) ) . build ( ) ) ) ; } } catch ( Exception tex ) { log . error ( JSONUtil . getJSON ( ImmutableMap . < String , String > builder ( ) . put ( LogMessage . USER , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . USER ) ) . put ( LogMessage . ACTION , String . format ( " Onboardcertificate " + "Exception = [%s] =  Message [%s] = certificate name = [%s]" , Arrays . toString ( tex . getStackTrace ( ) ) , tex . getMessage ( ) , sslCertificateRequest . getCertificateName ( ) ) ) . build ( ) ) ) ; return ResponseEntity . status ( HttpStatus . FORBIDDEN ) . body ( ERRORS + "Certificate onboard failed. " + "\"]}" ) ; } return ResponseEntity . status ( HttpStatus . OK ) . body ( MESSAGES + "Certficate onboarding is successfully completed. " + "\"]}" ) ; }
Method to Create policies and metadata for the given certificate
 @param certObject
Method to Create policies and metadata for the given certificate @param certObject