001    package org.cumulus4j.store;
002    
003    public class WorkInProgressException extends Cumulus4jException {
004    
005            private static final long serialVersionUID = 1L;
006    
007            private ProgressInfo progressInfo;
008    
009            protected static ProgressInfo nonNullProgressInfo(ProgressInfo progressInfo) {
010                    if (progressInfo == null)
011                            throw new IllegalArgumentException("progressInfo == null");
012    
013                    return progressInfo;
014            }
015    
016            /**
017             * Create an instance.
018             * @param progressInfo the {@link ProgressInfo}. Must not be <code>null</code>.
019             */
020            public WorkInProgressException(ProgressInfo progressInfo) {
021                    this.progressInfo = nonNullProgressInfo(progressInfo);
022            }
023    
024            /**
025             * Get the {@link ProgressInfo}.
026             * @return the {@link ProgressInfo}. Never <code>null</code>.
027             */
028            public ProgressInfo getProgressInfo() {
029                    return progressInfo;
030            }
031    }