Brooklyn

brooklyn.management.internal
[Java] Class LocalUsageManager

java.lang.Object
  brooklyn.management.internal.LocalUsageManager
All Implemented Interfaces:
UsageManager

public class LocalUsageManager

Field Summary
static java.lang.String APPLICATION_USAGE_KEY

static java.lang.String LOCATION_USAGE_KEY

 
Constructor Summary
LocalUsageManager(LocalManagementContext managementContext)

 
Method Summary
ApplicationUsage getApplicationUsage(java.lang.String appId)

Returns the usage info for the location with the given id, or null if unknown.

java.util.Set getApplicationUsage(Predicate filter)

LocationUsage getLocationUsage(java.lang.String locationId)

Returns the usage info for the location with the given id, or null if unknown.

java.util.Set getLocationUsage(Predicate filter)

void recordApplicationEvent(Application app, Lifecycle state)

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).

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Field Detail

APPLICATION_USAGE_KEY

private final LocalManagementContext managementContext;
public static final java.lang.String APPLICATION_USAGE_KEY


LOCATION_USAGE_KEY

public static final java.lang.String LOCATION_USAGE_KEY


 
Constructor Detail

LocalUsageManager

public LocalUsageManager(LocalManagementContext managementContext)


 
Method Detail

getApplicationUsage

Map usageMap = managementContext.getStorage().getMap(APPLICATION_USAGE_KEY);
public ApplicationUsage getApplicationUsage(java.lang.String appId)
Returns the usage info for the location with the given id, or null if unknown.


getApplicationUsage

public java.util.Set getApplicationUsage(Predicate filter)


getLocationUsage

// But this is good enough for first-pass.
public LocationUsage getLocationUsage(java.lang.String locationId)
Returns the usage info for the location with the given id, or null if unknown.


getLocationUsage

public java.util.Set getLocationUsage(Predicate filter)


recordApplicationEvent

if (usage == null) {
public void recordApplicationEvent(Application app, Lifecycle state)


recordLocationEvent

// can't change the config of the SshMachineLocation to subsequently affect the next
public 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).


 

Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.