tvaultapi/src/main/java/com/tmobile/cso/vault/api/service/SSLCertificateService.java
public ResponseEntity<String> onboardCerts(UserDetails userDetails,  String token, Integer from, Integer size) throws Exception {
		    	JsonArray responseArray;
		    	ResponseEntity<String> response;
		    	String bearerToken = authenticatePacbot(pacbotClientId,pacbotClientSecret);
		    	responseArray = getActiveCertificaesFromPacbot(bearerToken, from, size);
		    	JsonObject jsonObject;
		    	int successCount = 0;

				if(!ObjectUtils.isEmpty(responseArray) && responseArray.size()>0) {
					for (int i = 0; i < responseArray.size(); i++) {
						jsonObject  = responseArray.get(i).getAsJsonObject();
						if(!isCertAvailableInMetadata(jsonObject, token)) {
							response = createObjectAndOnboardCert(jsonObject,userDetails);
							if (response !=null && HttpStatus.OK.equals(response.getStatusCode())) {
							successCount++;
							}
						}
						else {
						continue;
						}
					}
					log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder().
							put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER)).
							put(LogMessage.ACTION, "onboardCerts").
							put(LogMessage.MESSAGE, String.format("[%s] - Certificates onboarded successfully.",successCount)).
							put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).
							build()));
				}	else {
					log.error(JSONUtil.getJSON(ImmutableMap.<String, String>builder().
		   					put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER)).
		   					put(LogMessage.ACTION, "onboardCerts").
		   					put(LogMessage.MESSAGE, "No valid certificates available for onbaording").
		   					put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).
		   					build()));
		   			
		   			return ResponseEntity.status(HttpStatus.NO_CONTENT).body("{\"errors\":[\"No certificate available for onbaording.\"]}");
				}
		    	return ResponseEntity.status(HttpStatus.OK).body("{\"messages\":[\"ssl certificates onboard completed successfully\"]}");
		    }
/**
		     * API to onboard all the valid certificates from NCLM in the Venafibin_12345 container to tvault
		     * @param userDetails
		     * @param bearerToken
		     * @return
		     * @throws Exception 
		     */
API to onboard all the valid certificates from NCLM in the Venafibin_12345 container to tvault
@param userDetails
@param bearerToken
@return
@throws Exception
API to onboard all the valid certificates from NCLM in the Venafibin_12345 container to tvault @param userDetails @param bearerToken @return @throws Exception
public ResponseEntity<String> onboardCerts(UserDetails userDetails,  String token, Integer from, Integer size) throws Exception {
		    	JsonArray responseArray;
		    	ResponseEntity<String> response;
		    	String bearerToken = authenticatePacbot(pacbotClientId,pacbotClientSecret);
		    	responseArray = getActiveCertificaesFromPacbot(bearerToken, from, size);
		    	JsonObject jsonObject;
		    	int successCount = 0;
				if(!ObjectUtils.isEmpty(responseArray) && responseArray.size()>0) {
					for (int i = 0; i < responseArray.size(); i++) {
						jsonObject  = responseArray.get(i).getAsJsonObject();
						if(!isCertAvailableInMetadata(jsonObject, token)) {
							response = createObjectAndOnboardCert(jsonObject,userDetails);
							if (response !=null && HttpStatus.OK.equals(response.getStatusCode())) {
							successCount++;
							}
						}
						else {
						continue;
						}
					}
					log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder().
							put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER)).
							put(LogMessage.ACTION, "onboardCerts").
							put(LogMessage.MESSAGE, String.format("[%s] - Certificates onboarded successfully.",successCount)).
							put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).
							build()));
				}	else {
					log.error(JSONUtil.getJSON(ImmutableMap.<String, String>builder().
		   					put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER)).
		   					put(LogMessage.ACTION, "onboardCerts").
		   					put(LogMessage.MESSAGE, "No valid certificates available for onbaording").
		   					put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).
		   					build()));
		   			return ResponseEntity.status(HttpStatus.NO_CONTENT).body("{\"errors\":[\"No certificate available for onbaording.\"]}");
				}
		    	return ResponseEntity.status(HttpStatus.OK).body("{\"messages\":[\"ssl certificates onboard completed successfully\"]}");
		    }
public ResponseEntity < String > onboardCerts ( UserDetails userDetails , String token , Integer from , Integer size ) throws Exception { JsonArray responseArray ; ResponseEntity < String > response ; String bearerToken = authenticatePacbot ( pacbotClientId , pacbotClientSecret ) ; responseArray = getActiveCertificaesFromPacbot ( bearerToken , from , size ) ; JsonObject jsonObject ; int successCount = 0 ; if ( ! ObjectUtils . isEmpty ( responseArray ) && responseArray . size ( ) > 0 ) { for ( int i = 0 ; i < responseArray . size ( ) ; i ++ ) { jsonObject = responseArray . get ( i ) . getAsJsonObject ( ) ; if ( ! isCertAvailableInMetadata ( jsonObject , token ) ) { response = createObjectAndOnboardCert ( jsonObject , userDetails ) ; if ( response != null && HttpStatus . OK . equals ( response . getStatusCode ( ) ) ) { successCount ++ ; } } else { continue ; } } log . debug ( JSONUtil . getJSON ( ImmutableMap . < String , String > builder ( ) . put ( LogMessage . USER , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . USER ) ) . put ( LogMessage . ACTION , "onboardCerts" ) . put ( LogMessage . MESSAGE , String . format ( "[%s] - Certificates onboarded successfully." , successCount ) ) . put ( LogMessage . APIURL , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . APIURL ) ) . build ( ) ) ) ; } else { log . error ( JSONUtil . getJSON ( ImmutableMap . < String , String > builder ( ) . put ( LogMessage . USER , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . USER ) ) . put ( LogMessage . ACTION , "onboardCerts" ) . put ( LogMessage . MESSAGE , "No valid certificates available for onbaording" ) . put ( LogMessage . APIURL , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . APIURL ) ) . build ( ) ) ) ; return ResponseEntity . status ( HttpStatus . NO_CONTENT ) . body ( "{\"errors\":[\"No certificate available for onbaording.\"]}" ) ; } return ResponseEntity . status ( HttpStatus . OK ) . body ( "{\"messages\":[\"ssl certificates onboard completed successfully\"]}" ) ; }
API to onboard all the valid certificates from NCLM in the Venafibin_12345 container to tvault
 @param userDetails
 @param bearerToken
 @return
 @throws Exception
API to onboard all the valid certificates from NCLM in the Venafibin_12345 container to tvault @param userDetails @param bearerToken @return @throws Exception