package com.tandbergtv.watchpoint.pmm.util;

import java.util.Properties;

import org.apache.log4j.Logger;

/**
 * Helper class which gets the spec independent status message names and values
 * given the title section(same as item type).
 * 
 * @author spuranik
 * 
 */
public class ProgressStatusHelper {
	private static final Logger logger = Logger.getLogger(ProgressStatusHelper.class);
	
	/* suffix for name and values for various item types */
	private static String ASSET_RECEIVED_SUFFIX = "RECEIVED";

	public static String CREATED;
	public static String UPDATED;
	public static String VALIDATION_SUCCESS;
	public static String VALIDATION_FAILURE;
	public static String NATIONALIZED;

	static {
		Properties props = new Properties();
		try {
			props.loadFromXML(ProgressStatusHelper.class.getResourceAsStream("progressMessages.properties"));
			CREATED = props.getProperty("created");
			UPDATED = props.getProperty("updated");
			VALIDATION_SUCCESS = props.getProperty("validationSuccess");
			VALIDATION_FAILURE = props.getProperty("validationFailure");
			NATIONALIZED = props.getProperty("nationalized");
		} catch (Exception e) {
			logger.error("Failed to load progressMessages.properties", e);
		}
	}
	
	public static String getAssetReceivedStatusName(String sectionName) {
		return sectionName.toUpperCase() + " " + ASSET_RECEIVED_SUFFIX;
	}

	public static String getAssetReceivedStatusValue(String sectionName) {
		return null;
	}

	public static String getMetadataReceivedStatusName() {
		return getAssetReceivedStatusName("METADATA");
	}

	public static String getMetadataReceivedValue() {
		return null;
	}
	
}
