Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Code Block
                     while (st.hasMoreTokens()) {
                        final String token = st.nextToken();
                        final CommandType listType = annotation.collectionType();...
                        switch (listType) {
                            case INTEGER:
                                listParam.add(Integer.valueOf(token));
                                break;
                            case UUID:
                                if (token.isEmpty())
                                    break;
                                final Long internalId = translateUuidToInternalId(token, annotation);
                                listParam.add(internalId);
                                break;
                            ...
  case    LONG: {
                 }
               listParam.add(Long.valueOf(token));
                            }
                                break;
                            case SHORT:
                                listParam.add(Short.valueOf(token));
                            case STRING:
                                listParam.add(token);
                                break;
                        }
                    }
                    field.set(cmdObj, listParam);
                    break;
     ...

Detailed error messages in events

In case of events logged due to an error occurred while processing a job or change of state of a resource , a detailed error message describing the reason of failure would be logged into the error_message field of the event. Based on who the user is an admin or a normal user relevant error message would be shown to the end user.

How would error_message data be filled?

Currently, the error messages are ignored in case of any exceptions while a job is performed. The event interceptors in case of error log error events with the hard coded description provided in the event files.

Code Block
public class ActionEventInterceptor implements ComponentMethodInterceptor, MethodInterceptor {
...
 
@Override
public Object invoke(MethodInvocation invocation) throws Throwable {
    ...
    try {
        interceptorData =  case UUID:
        interceptStart(m, target);
        Object result =  if (paramObj.toString().isEmpty())invocation.proceed();
        success = true;
        return result;
    } finally break;{
        if (success) {
          final Long internalId = translateUuidToInternalId(paramObj.toString(), annotationinterceptComplete(m, target, interceptorData);
        } else   {
        field.set(cmdObj, internalId);
      interceptException(m, target, interceptorData);
        }
    break;

Detailed error messages

}
...

A catch block would help to have descriptive error messages, instead of displaying short un-descriptive event descriptions in case of error events.

Externalize the event descriptions strings

The event descriptions are currently hard coded in the java files. These strings could be externalize to a resource bundle like in a message.properties file, and can be processed in the event interceptors before an event is logged. 

 In case of events logged due to an error occurred while processing a job or change of state of a resource , a detailed error message describing the reason of failure would be logged into the error_message field of the event. Based on who the user is an admin or a normal user relevant error message would be shown to the end user.