public class DownloadsStatusEventPublisher extends Object
DownloadsStatusEventPublisher
class creates events and sends them using the EventAdmin
service interface.Modifier and Type | Class and Description |
---|---|
static class |
DownloadsStatusEventPublisher.ProductRetrievalStatus |
Modifier and Type | Field and Description |
---|---|
static String |
APPLICATION_NAME |
static String |
BYTES |
static String |
DETAIL |
static String |
STATUS |
Constructor and Description |
---|
DownloadsStatusEventPublisher(org.osgi.service.event.EventAdmin eventAdmin,
List<ActionProvider> actionProviders)
Used to publish product retrieval status updates via the OSGi Event Service
|
Modifier and Type | Method and Description |
---|---|
void |
postRetrievalStatus(ResourceResponse resourceResponse,
DownloadsStatusEventPublisher.ProductRetrievalStatus status,
Metacard metacard,
String detail,
Long bytes,
String downloadIdentifier)
Send notification and activity with current retrieval status.
|
void |
postRetrievalStatus(ResourceResponse resourceResponse,
DownloadsStatusEventPublisher.ProductRetrievalStatus status,
Metacard metacard,
String detail,
Long bytes,
String downloadIdentifier,
boolean sendNotification,
boolean sendActivity)
Based on the input parameters send notification and/or activity with current retrieval status.
|
void |
setActivityEnabled(boolean enabled) |
void |
setNotificationEnabled(boolean enabled) |
public static final String APPLICATION_NAME
public static final String DETAIL
public static final String STATUS
public static final String BYTES
public DownloadsStatusEventPublisher(org.osgi.service.event.EventAdmin eventAdmin, List<ActionProvider> actionProviders)
public void postRetrievalStatus(ResourceResponse resourceResponse, DownloadsStatusEventPublisher.ProductRetrievalStatus status, Metacard metacard, String detail, Long bytes, String downloadIdentifier)
resourceResponse
- the response from the product retrieval containing the actual @Resourcestatus
- the status of the product retrieval, e.g., IN_PROGRESS, STARTED, etc.metacard
- the @Metacard associated with the product being downloadeddetail
- detailed message to be displayed in the notification and/or activitybytes
- the number of bytes read thus far during the product downloaddownloadIdentifier
- unique ID for this product downloadpublic void postRetrievalStatus(ResourceResponse resourceResponse, DownloadsStatusEventPublisher.ProductRetrievalStatus status, Metacard metacard, String detail, Long bytes, String downloadIdentifier, boolean sendNotification, boolean sendActivity)
resourceResponse
- the response from the product retrieval containing the actual @Resourcestatus
- the status of the product retrieval, e.g., IN_PROGRESS, STARTED, etc.metacard
- the @Metacard associated with the product being downloadeddetail
- detailed message to be displayed in the notification and/or activitybytes
- the number of bytes read thus far during the product downloaddownloadIdentifier
- unique ID for this product downloadsendNotification
- true indicates a notification with current retrieval status is to be
sentsendActivity
- true indicates an activity with current retrieval status is to be sentpublic void setNotificationEnabled(boolean enabled)
public void setActivityEnabled(boolean enabled)
This work is licensed under a Creative Commons Attribution 4.0 International License.