001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.kernel.backgroundtask;
016    
017    import com.liferay.portal.kernel.exception.PortalException;
018    import com.liferay.portal.kernel.repository.model.FileEntry;
019    import com.liferay.portal.kernel.repository.model.Folder;
020    import com.liferay.portal.model.BaseModel;
021    
022    import java.io.File;
023    import java.io.InputStream;
024    import java.io.Serializable;
025    
026    import java.util.Date;
027    import java.util.List;
028    import java.util.Map;
029    
030    /**
031     * @author Michael C. Han
032     */
033    public interface BackgroundTask {
034    
035            public void addAttachment(long userId, String fileName, File file)
036                    throws PortalException;
037    
038            public void addAttachment(
039                            long userId, String fileName, InputStream inputStream)
040                    throws PortalException;
041    
042            public Folder addAttachmentsFolder() throws PortalException;
043    
044            public List<FileEntry> getAttachmentsFileEntries() throws PortalException;
045    
046            public int getAttachmentsFileEntriesCount() throws PortalException;
047    
048            public long getAttachmentsFolderId();
049    
050            public long getBackgroundTaskId();
051    
052            public long getCompanyId();
053    
054            public Date getCompletionDate();
055    
056            public Date getCreateDate();
057    
058            public long getGroupId();
059    
060            public BaseModel<?> getModel();
061    
062            public String getName();
063    
064            public String getServletContextNames();
065    
066            public int getStatus();
067    
068            public String getStatusLabel();
069    
070            public String getStatusMessage();
071    
072            public Map<String, Serializable> getTaskContextMap();
073    
074            public String getTaskExecutorClassName();
075    
076            public long getUserId();
077    
078            public boolean isCompleted();
079    
080            public boolean isInProgress();
081    
082            public void setTaskContextMap(Map<String, Serializable> taskContextMap);
083    
084    }