tvaultapi/src/main/java/com/tmobile/cso/vault/api/controller/ControllerUtil.java
public static Response updateMetadataOnSvcPwdReset(String path,
			ADServiceAccountResetDetails adServiceAccountResetDetails, String token) {
		String svcPath = METADATASTR + path;
		ObjectMapper objMapper = new ObjectMapper();
		String pathjson = PATHSTR + svcPath + "\"}";

		Response metadataResponse = reqProcessor.process(READSTR, pathjson, token);
		Map<String, Object> svcMetadataMap = null;
		if (HttpStatus.OK.equals(metadataResponse.getHttpstatus())) {
			try {
				svcMetadataMap = objMapper.readValue(metadataResponse.getResponse(),
						new TypeReference<Map<String, Object>>() {
						});
			} catch (IOException e) {
				log.error(e);
				log.error(
						JSONUtil.getJSON(ImmutableMap.<String, String> builder()
								.put(LogMessage.USER,
										ThreadLocalContext.getCurrentMap().get(LogMessage.USER))
								.put(LogMessage.ACTION, UPDATEMETADATASTR)
								.put(LogMessage.MESSAGE,
										String.format(
												"Error creating _metadataMap for type service account update, message [%s]",
												e.getMessage()))
								.put(LogMessage.APIURL,
										ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL))
								.build()));
			}

			@SuppressWarnings("unchecked")
			Map<String, Object> metadataMap = (Map<String, Object>) svcMetadataMap.get("data");

			metadataMap.put("modifiedBy", adServiceAccountResetDetails.getModifiedBy());
			metadataMap.put("modifiedAt", adServiceAccountResetDetails.getModifiedAt());

			String metadataJson = "";
			try {
				metadataJson = objMapper.writeValueAsString(metadataMap);
			} catch (JsonProcessingException e) {
				log.error(e);
				log.error(
						JSONUtil.getJSON(ImmutableMap.<String, String> builder()
								.put(LogMessage.USER,
										ThreadLocalContext.getCurrentMap().get(LogMessage.USER))
								.put(LogMessage.ACTION, UPDATEMETADATASTR)
								.put(LogMessage.MESSAGE,
										String.format(
												"Error creating _metadataMap for type service account update, message [%s]",
												e.getMessage()))
								.put(LogMessage.APIURL,
										ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL))
								.build()));
			}

			String writeJson = PATHSTR + svcPath + DATASTR + metadataJson + "}";
			metadataResponse = reqProcessor.process(WRITESTR, writeJson, token);
			return metadataResponse;
		}
		return null;

	}
/**
	 * Update metadata on service account password reset - modifiedBy and
	 * modifiedAt
	 * 
	 * @param params
	 * @param token
	 * @return
	 */
Update metadata on service account password reset - modifiedBy and
modifiedAt

@param params
@param token
@return
Update metadata on service account password reset - modifiedBy and modifiedAt @param params @param token @return
public static Response updateMetadataOnSvcPwdReset(String path,
			ADServiceAccountResetDetails adServiceAccountResetDetails, String token) {
		String svcPath = METADATASTR + path;
		ObjectMapper objMapper = new ObjectMapper();
		String pathjson = PATHSTR + svcPath + "\"}";
		Response metadataResponse = reqProcessor.process(READSTR, pathjson, token);
		Map<String, Object> svcMetadataMap = null;
		if (HttpStatus.OK.equals(metadataResponse.getHttpstatus())) {
			try {
				svcMetadataMap = objMapper.readValue(metadataResponse.getResponse(),
						new TypeReference<Map<String, Object>>() {
						});
			} catch (IOException e) {
				log.error(e);
				log.error(
						JSONUtil.getJSON(ImmutableMap.<String, String> builder()
								.put(LogMessage.USER,
										ThreadLocalContext.getCurrentMap().get(LogMessage.USER))
								.put(LogMessage.ACTION, UPDATEMETADATASTR)
								.put(LogMessage.MESSAGE,
										String.format(
												"Error creating _metadataMap for type service account update, message [%s]",
												e.getMessage()))
								.put(LogMessage.APIURL,
										ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL))
								.build()));
			}
			@SuppressWarnings("unchecked")
			Map<String, Object> metadataMap = (Map<String, Object>) svcMetadataMap.get("data");
			metadataMap.put("modifiedBy", adServiceAccountResetDetails.getModifiedBy());
			metadataMap.put("modifiedAt", adServiceAccountResetDetails.getModifiedAt());
			String metadataJson = "";
			try {
				metadataJson = objMapper.writeValueAsString(metadataMap);
			} catch (JsonProcessingException e) {
				log.error(e);
				log.error(
						JSONUtil.getJSON(ImmutableMap.<String, String> builder()
								.put(LogMessage.USER,
										ThreadLocalContext.getCurrentMap().get(LogMessage.USER))
								.put(LogMessage.ACTION, UPDATEMETADATASTR)
								.put(LogMessage.MESSAGE,
										String.format(
												"Error creating _metadataMap for type service account update, message [%s]",
												e.getMessage()))
								.put(LogMessage.APIURL,
										ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL))
								.build()));
			}
			String writeJson = PATHSTR + svcPath + DATASTR + metadataJson + "}";
			metadataResponse = reqProcessor.process(WRITESTR, writeJson, token);
			return metadataResponse;
		}
		return null;
	}
public static Response updateMetadataOnSvcPwdReset ( String path , ADServiceAccountResetDetails adServiceAccountResetDetails , String token ) { String svcPath = METADATASTR + path ; ObjectMapper objMapper = new ObjectMapper ( ) ; String pathjson = PATHSTR + svcPath + "\"}" ; Response metadataResponse = reqProcessor . process ( READSTR , pathjson , token ) ; Map < String , Object > svcMetadataMap = null ; if ( HttpStatus . OK . equals ( metadataResponse . getHttpstatus ( ) ) ) { try { svcMetadataMap = objMapper . readValue ( metadataResponse . getResponse ( ) , new TypeReference < Map < String , Object > > ( ) { } ) ; } catch ( IOException e ) { log . error ( e ) ; log . error ( JSONUtil . getJSON ( ImmutableMap . < String , String > builder ( ) . put ( LogMessage . USER , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . USER ) ) . put ( LogMessage . ACTION , UPDATEMETADATASTR ) . put ( LogMessage . MESSAGE , String . format ( "Error creating _metadataMap for type service account update, message [%s]" , e . getMessage ( ) ) ) . put ( LogMessage . APIURL , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . APIURL ) ) . build ( ) ) ) ; } @ SuppressWarnings ( "unchecked" ) Map < String , Object > metadataMap = ( Map < String , Object > ) svcMetadataMap . get ( "data" ) ; metadataMap . put ( "modifiedBy" , adServiceAccountResetDetails . getModifiedBy ( ) ) ; metadataMap . put ( "modifiedAt" , adServiceAccountResetDetails . getModifiedAt ( ) ) ; String metadataJson = "" ; try { metadataJson = objMapper . writeValueAsString ( metadataMap ) ; } catch ( JsonProcessingException e ) { log . error ( e ) ; log . error ( JSONUtil . getJSON ( ImmutableMap . < String , String > builder ( ) . put ( LogMessage . USER , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . USER ) ) . put ( LogMessage . ACTION , UPDATEMETADATASTR ) . put ( LogMessage . MESSAGE , String . format ( "Error creating _metadataMap for type service account update, message [%s]" , e . getMessage ( ) ) ) . put ( LogMessage . APIURL , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . APIURL ) ) . build ( ) ) ) ; } String writeJson = PATHSTR + svcPath + DATASTR + metadataJson + "}" ; metadataResponse = reqProcessor . process ( WRITESTR , writeJson , token ) ; return metadataResponse ; } return null ; }
Update metadata on service account password reset - modifiedBy and
 modifiedAt
Update metadata on service account password reset - modifiedBy and modifiedAt