public class LocalUsageManager extends java.lang.Object implements UsageManager
UsageManager.UsageListener| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
APPLICATION_USAGE_KEY |
static java.lang.String |
LOCATION_USAGE_KEY |
USAGE_LISTENER_TERMINATION_TIMEOUT, USAGE_LISTENERS| Constructor and Description |
|---|
LocalUsageManager(LocalManagementContext managementContext) |
| Modifier and Type | Method and Description |
|---|---|
void |
addUsageListener(UsageListener listener)
Adds the given listener, to be notified on recording of application/location events.
|
void |
addUsageListener(UsageManager.UsageListener listener)
Deprecated.
|
java.util.Set<ApplicationUsage> |
getApplicationUsage(com.google.common.base.Predicate<? super ApplicationUsage> filter)
Returns the usage info that matches the given predicate.
|
ApplicationUsage |
getApplicationUsage(java.lang.String appId)
Returns the usage info for the location with the given id, or null if unknown.
|
java.util.Set<LocationUsage> |
getLocationUsage(com.google.common.base.Predicate<? super LocationUsage> filter)
Returns the usage info that matches the given predicate.
|
LocationUsage |
getLocationUsage(java.lang.String locationId)
Returns the usage info for the location with the given id, or null if unknown.
|
void |
recordApplicationEvent(Application app,
Lifecycle state)
Adds this application event to the usage record for the given app (creating the usage
record if one does not already exist).
|
void |
recordLocationEvent(Location loc,
Lifecycle state)
Adds this location event to the usage record for the given location (creating the usage
record if one does not already exist).
|
void |
removeUsageListener(UsageListener listener)
Removes the given listener.
|
void |
removeUsageListener(UsageManager.UsageListener listener)
Deprecated.
|
void |
terminate() |
public static final java.lang.String APPLICATION_USAGE_KEY
public static final java.lang.String LOCATION_USAGE_KEY
public LocalUsageManager(LocalManagementContext managementContext)
public void terminate()
public void recordApplicationEvent(Application app, Lifecycle state)
UsageManagerrecordApplicationEvent in interface UsageManagerpublic void recordLocationEvent(Location loc, Lifecycle state)
recordLocationEvent in interface UsageManagerpublic LocationUsage getLocationUsage(java.lang.String locationId)
getLocationUsage in interface UsageManagerpublic java.util.Set<LocationUsage> getLocationUsage(com.google.common.base.Predicate<? super LocationUsage> filter)
getLocationUsage in interface UsageManagerpublic ApplicationUsage getApplicationUsage(java.lang.String appId)
getApplicationUsage in interface UsageManagerpublic java.util.Set<ApplicationUsage> getApplicationUsage(com.google.common.base.Predicate<? super ApplicationUsage> filter)
getApplicationUsage in interface UsageManager@Deprecated public void addUsageListener(UsageManager.UsageListener listener)
addUsageListener in interface UsageManager@Deprecated public void removeUsageListener(UsageManager.UsageListener listener)
removeUsageListener in interface UsageManagerpublic void addUsageListener(UsageListener listener)
UsageManageraddUsageListener in interface UsageManagerpublic void removeUsageListener(UsageListener listener)
UsageManagerremoveUsageListener in interface UsageManager