com.dell.isg.smi.commons.elm.messaging.MessageReaderFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of commons-elm Show documentation
Show all versions of commons-elm Show documentation
Commons Exception and Localized Messaging (ELM) jar library for the System Management Integration (SMI) projects.
/**
* Copyright ? 2017 DELL Inc. or its subsidiaries. All Rights Reserved.
*/
package com.dell.isg.smi.commons.elm.messaging;
import java.util.Locale;
/**
* A factory for creating MessageReader objects.
*/
public class MessageReaderFactory {
/**
* Creates reader with the given locale.
*
* @param msgCode the msg code
* @param locale - Locale to in initialize the reader with.
* @return the i message reader
*/
public static IMessageReader createReader(String msgCode, Locale locale) {
MessageReaderType type = getReaderType(msgCode);
switch (type) {
case FriendlyLogBundleReader:
return new FriendlyMessageBundleReader(locale);
default:
return null;
}
}
// /**
// * Creates reader with default locale.
// * @param type - Reader type.
// * @return
// */
// public static IMessageReader createReader(String msgCode){
// MessageReaderType type = getReaderType(msgCode);
// switch (type){
// case FriendlyLogBundleReader:
// return new FriendlyMessageBundleReader();
// default:
// return null;
// }
// }
/**
* Gets the reader type.
*
* @param msgCode the msg code
* @return the reader type
*/
private static MessageReaderType getReaderType(String msgCode) {
return MessageReaderType.FriendlyLogBundleReader;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy