Brooklyn

brooklyn.entity.chef
[Java] Class ChefAttributeFeed

java.lang.Object
  brooklyn.event.feed.AbstractFeed
      brooklyn.entity.chef.ChefAttributeFeed

public class ChefAttributeFeed
extends AbstractFeed

A sensor feed that retrieves attributes from Chef server and converts selected attributes to sensors.

To use this feed, you must provide the entity, the name of the node as it is known to Chef, and a collection of attribute sensors. The attribute sensors must follow the naming convention of starting with the string chef.attribute. followed by a period-separated path through the Chef attribute hierarchy. For example, an attribute sensor named chef.attribute.sql_server.instance_name would cause the feed to search for a Chef attribute called sql_server, and within that an attribute instance_name, and set the sensor to the value of this attribute.

This feed uses the knife tool to query all the attributes on a named node. It then iterates over the configured list of attribute sensors, using the sensor name to locate an equivalent Chef attribute. The sensor is then set to the value of the Chef attribute.

Example:

@Override protected void connectSensors() { nodeAttributesFeed = ChefAttributeFeed.newFeed(this, nodeName, new AttributeSensor[]{ SqlServerNode.CHEF_ATTRIBUTE_NODE_NAME, SqlServerNode.CHEF_ATTRIBUTE_SQL_SERVER_INSTANCE_NAME, SqlServerNode.CHEF_ATTRIBUTE_SQL_SERVER_PORT, SqlServerNode.CHEF_ATTRIBUTE_SQL_SERVER_SA_PASSWORD ); } }
Authors:
richardcloudsoft
Since:
0.6.0


Nested Class Summary
static class ChefAttributeFeed.Builder

 
Field Summary
static java.lang.String CHEF_ATTRIBUTE_PREFIX

Prefix for attribute sensor names.

 
Fields inherited from class AbstractFeed
entity, poller
 
Method Summary
protected java.lang.Object ChefAttributeFeed(ChefAttributeFeed.Builder builder)

static ChefAttributeFeed.Builder builder()

protected void preStart()

 
Methods inherited from class AbstractFeed
getEntity, isActivated, isActive, isConnected, postStop, preStart, preStop, resume, start, stop, suspend
 

Field Detail

CHEF_ATTRIBUTE_PREFIX

public static final java.lang.String CHEF_ATTRIBUTE_PREFIX
Prefix for attribute sensor names.


 
Method Detail

ChefAttributeFeed

protected java.lang.Object ChefAttributeFeed(ChefAttributeFeed.Builder builder)


builder

public static ChefAttributeFeed.Builder builder()


preStart

@Override
protected void preStart()


 

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