tvaultapi/src/main/java/com/tmobile/cso/vault/api/controller/ControllerUtil.java
public static String populateSharedToUserMetaJson(String ownerUsername, String sharedToUser, AppRole appRole) {
		log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder().
				put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER)).
				put(LogMessage.ACTION, "populateSharedToUserMetaJson").
				put(LogMessage.MESSAGE,"Start populating approle metadata json with the shared to user information.").
				put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).
				build()));

		String _path = TVaultConstants.APPROLE_USERS_METADATA_MOUNT_PATH + "/" + sharedToUser +"/" + appRole.getRole_name();
		AppRoleMetadataDetails appRoleMetadataDetails = new AppRoleMetadataDetails(appRole.getRole_name());
		appRoleMetadataDetails.setCreatedBy(ownerUsername);
		appRoleMetadataDetails.setSharedTo(appRole.getShared_to());
		AppRoleMetadata appRoleMetadata =  new AppRoleMetadata(_path, appRoleMetadataDetails);
		String jsonStr = JSONUtil.getJSON(appRoleMetadata);
		Map<String,Object> rqstParams = ControllerUtil.parseJson(jsonStr);
		rqstParams.put("path", _path);

		return ControllerUtil.convetToJson(rqstParams);
	}
/**
	 * Populate approle metadata json with the sharedTo user information
	 * @param ownerUsername
	 * @param sharedToUser
	 * @param appRole
	 * @return String
	 */
Populate approle metadata json with the sharedTo user information
@param ownerUsername
@param sharedToUser
@param appRole
@return String
Populate approle metadata json with the sharedTo user information @param ownerUsername @param sharedToUser @param appRole @return String
public static String populateSharedToUserMetaJson(String ownerUsername, String sharedToUser, AppRole appRole) {
		log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder().
				put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER)).
				put(LogMessage.ACTION, "populateSharedToUserMetaJson").
				put(LogMessage.MESSAGE,"Start populating approle metadata json with the shared to user information.").
				put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).
				build()));
		String _path = TVaultConstants.APPROLE_USERS_METADATA_MOUNT_PATH + "/" + sharedToUser +"/" + appRole.getRole_name();
		AppRoleMetadataDetails appRoleMetadataDetails = new AppRoleMetadataDetails(appRole.getRole_name());
		appRoleMetadataDetails.setCreatedBy(ownerUsername);
		appRoleMetadataDetails.setSharedTo(appRole.getShared_to());
		AppRoleMetadata appRoleMetadata =  new AppRoleMetadata(_path, appRoleMetadataDetails);
		String jsonStr = JSONUtil.getJSON(appRoleMetadata);
		Map<String,Object> rqstParams = ControllerUtil.parseJson(jsonStr);
		rqstParams.put("path", _path);
		return ControllerUtil.convetToJson(rqstParams);
	}
public static String populateSharedToUserMetaJson ( String ownerUsername , String sharedToUser , AppRole appRole ) { log . debug ( JSONUtil . getJSON ( ImmutableMap . < String , String > builder ( ) . put ( LogMessage . USER , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . USER ) ) . put ( LogMessage . ACTION , "populateSharedToUserMetaJson" ) . put ( LogMessage . MESSAGE , "Start populating approle metadata json with the shared to user information." ) . put ( LogMessage . APIURL , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . APIURL ) ) . build ( ) ) ) ; String _path = TVaultConstants . APPROLE_USERS_METADATA_MOUNT_PATH + "/" + sharedToUser + "/" + appRole . getRole_name ( ) ; AppRoleMetadataDetails appRoleMetadataDetails = new AppRoleMetadataDetails ( appRole . getRole_name ( ) ) ; appRoleMetadataDetails . setCreatedBy ( ownerUsername ) ; appRoleMetadataDetails . setSharedTo ( appRole . getShared_to ( ) ) ; AppRoleMetadata appRoleMetadata = new AppRoleMetadata ( _path , appRoleMetadataDetails ) ; String jsonStr = JSONUtil . getJSON ( appRoleMetadata ) ; Map < String , Object > rqstParams = ControllerUtil . parseJson ( jsonStr ) ; rqstParams . put ( "path" , _path ) ; return ControllerUtil . convetToJson ( rqstParams ) ; }
Populate approle metadata json with the sharedTo user information
 @param ownerUsername
 @param sharedToUser
 @param appRole
 @return String
Populate approle metadata json with the sharedTo user information @param ownerUsername @param sharedToUser @param appRole @return String