* @author E.Santoboni
*/
public class ApiMessageTypeInterface {
public JAXBMessageType getMessageType(Properties properties) throws ApiException, Throwable {
JAXBMessageType jaxbMessageType = null;
try {
String typeCode = properties.getProperty("typeCode");
IApsEntity masterMessageType = this.getMessageManager().getEntityPrototype(typeCode);
if (null == masterMessageType) {
throw new ApiException(IApiErrorCodes.API_VALIDATION_ERROR,
"Message type with code '" + typeCode + "' does not exist", Response.Status.CONFLICT);
}
jaxbMessageType = new JAXBMessageType(masterMessageType);
} catch (ApiException ae) {
throw ae;
} catch (Throwable t) {
ApsSystemUtils.logThrowable(t, this, "getMessageType");
throw new ApsSystemException("Error extracting message type", t);