Search in sources :

Example 1 with DeclareServiceCode

use of com.emc.storageos.svcs.errorhandling.annotations.DeclareServiceCode in project coprhd-controller by CoprHD.

the class ExceptionMessagesProxy method serviceCode.

/**
 * Get the specified {@link ServiceCode} from the {@link DeclareServiceCode} annotation
 *
 * @param method
 * @return
 */
private ServiceCode serviceCode(final Method method) {
    final DeclareServiceCode declaredServiceCode = method.getAnnotation(DeclareServiceCode.class);
    if (declaredServiceCode == null) {
        throw new IllegalStateException("A service code must be provided via @DeclareServiceCode");
    }
    final ServiceCode serviceCode = declaredServiceCode.value();
    return serviceCode;
}
Also used : DeclareServiceCode(com.emc.storageos.svcs.errorhandling.annotations.DeclareServiceCode) ServiceCode(com.emc.storageos.svcs.errorhandling.resources.ServiceCode) DeclareServiceCode(com.emc.storageos.svcs.errorhandling.annotations.DeclareServiceCode)

Aggregations

DeclareServiceCode (com.emc.storageos.svcs.errorhandling.annotations.DeclareServiceCode)1 ServiceCode (com.emc.storageos.svcs.errorhandling.resources.ServiceCode)1