tvaultapi/src/main/java/com/tmobile/cso/vault/api/controller/ControllerUtil.java
public static  String populateUserMetaJson(AppRole appRole, String username) {
    	log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder().
			      put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER)).
				  put(LogMessage.ACTION, "populateUserMetaJson").
			      put(LogMessage.MESSAGE,"Start populating approle metadata json with the user information.").
			      put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).
			      build()));
        String _path = TVaultConstants.APPROLE_USERS_METADATA_MOUNT_PATH + "/" + username +"/" + appRole.getRole_name();
        AppRoleMetadataDetails appRoleMetadataDetails = new AppRoleMetadataDetails(appRole.getRole_name());
        appRoleMetadataDetails.setCreatedBy(username);
        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 user information
     * @param appRole
     * @param username
     * @return String
     */
Populate approle metadata json with the user information
@param appRole
@param username
@return String
Populate approle metadata json with the user information @param appRole @param username @return String
public static  String populateUserMetaJson(AppRole appRole, String username) {
    	log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder().
			      put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER)).
				  put(LogMessage.ACTION, "populateUserMetaJson").
			      put(LogMessage.MESSAGE,"Start populating approle metadata json with the user information.").
			      put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).
			      build()));
        String _path = TVaultConstants.APPROLE_USERS_METADATA_MOUNT_PATH + "/" + username +"/" + appRole.getRole_name();
        AppRoleMetadataDetails appRoleMetadataDetails = new AppRoleMetadataDetails(appRole.getRole_name());
        appRoleMetadataDetails.setCreatedBy(username);
        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 populateUserMetaJson ( AppRole appRole , String username ) { log . debug ( JSONUtil . getJSON ( ImmutableMap . < String , String > builder ( ) . put ( LogMessage . USER , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . USER ) ) . put ( LogMessage . ACTION , "populateUserMetaJson" ) . put ( LogMessage . MESSAGE , "Start populating approle metadata json with the user information." ) . put ( LogMessage . APIURL , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . APIURL ) ) . build ( ) ) ) ; String _path = TVaultConstants . APPROLE_USERS_METADATA_MOUNT_PATH + "/" + username + "/" + appRole . getRole_name ( ) ; AppRoleMetadataDetails appRoleMetadataDetails = new AppRoleMetadataDetails ( appRole . getRole_name ( ) ) ; appRoleMetadataDetails . setCreatedBy ( username ) ; 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 user information
 @param appRole
 @param username
 @return String
Populate approle metadata json with the user information @param appRole @param username @return String