Groovy Documentation

org.linkedin.glu.provisioner.core.model
[Groovy] Class SystemModel

java.lang.Object
  org.linkedin.glu.provisioner.core.model.SystemModel

class SystemModel

Authors:
ypujante@linkedin.com


Field Summary
static OneWayCodec SHA1

static SystemModelSerializer TO_STRING_SERIALIZER

 
Property Summary
java.lang.String fabric

SystemFilter filters

java.lang.String id

java.util.Map metadata

 
Method Summary
void addAgentTags(java.lang.String agentName, java.util.Collection tags)

Adds the agent tags

void addEntry(SystemEntry entry)

SystemModel clone()

SystemModel cloneNoEntries()

java.lang.String computeContentSha1()

@return the sha1 of the content (does not include the id)

java.lang.Object computeStats()

java.lang.Object computeStats(java.lang.Object keys)

Computes the stats of this model limited by the set of keys provided.

java.lang.Object each(groovy.lang.Closure closure)

boolean equals(java.lang.Object o)

static java.util.List filter(SystemModel system1, SystemModel system2)

Filters the 2 models in the following way:

  • filter system2 with all filter applied to system1
  • filter system1 with all filter applied to system2
  • compute union of keys between system1 and system2
  • unfilter system1 and apply new filter which filters by keys
  • unfilter system2 and apply new filter which filters by keys

SystemModel filterBy(SystemModel system)

Apply all the filters from the provided system model.

SystemModel filterBy(java.lang.String filter)

The filter is a dsl

SystemModel filterBy(SystemFilter filter)

@return a model that has been filtered by the provided filter

SystemModel filterBy(groovy.lang.Closure filter)

@param filter (will be called for each entry (SystemEntry) and should return true if the entry should be included, false for excluded

SystemModel filterBy(java.lang.String name, groovy.lang.Closure filter)

@param filter (will be called for each entry (SystemEntry) and should return true if the entry should be included, false for excluded

SystemModel filterBy(java.lang.String name, java.lang.Object value)

This is a shortcut to apply a filter of the style: se."

SystemModel filterByMetadata(java.lang.String name, java.lang.Object value)

This is a shortcut to apply a filter where the metadata matches the value

static java.util.Set filterKeys(SystemModel system1, SystemModel system2)

Filters the 2 models in the following way:

  • filter system2 with all filter applied to system1
  • filter system1 with all filter applied to system2
  • compute and return union of keys between system1 and system2

java.util.Collection findChildrenKeys(java.lang.String parentKey)

java.util.Collection findEntries()

SystemEntry findEntry(java.lang.String agent, java.lang.String mountPoint)

SystemEntry findEntry(java.lang.String key)

static SystemModel fromExternalRepresentation(java.lang.Object er)

ReadOnlyTaggeable getAgentTags(java.lang.String agentName)

@return the tags of the given agent

java.util.Map getAgentTags()

@return all the agent tags

T getKeys(T keys)

java.lang.Object groupByEntryMetadata(java.lang.String name)

@return a collection with all the unique values for entry.metadata[name]

int hashCode()

void removeEntry(java.lang.String key)

java.lang.Object toCanonicalRepresentation()

In the canonical representation, the agent tags are removed from the entry tags

java.lang.Object toExternalRepresentation()

java.lang.Object toExternalRepresentation(boolean includeEntries)

java.lang.String toString()

SystemModel unfilter()

@return the system as it was unfiltered

void updateEntry(SystemEntry entry)

 
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

SHA1

public static final OneWayCodec SHA1


TO_STRING_SERIALIZER

public static final SystemModelSerializer TO_STRING_SERIALIZER


 
Property Detail

fabric

java.lang.String fabric


filters

SystemFilter filters


id

java.lang.String id


metadata

java.util.Map metadata


 
Method Detail

addAgentTags

void addAgentTags(java.lang.String agentName, java.util.Collection tags)
Adds the agent tags


addEntry

void addEntry(SystemEntry entry)


clone

SystemModel clone()


cloneNoEntries

SystemModel cloneNoEntries()


computeContentSha1

java.lang.String computeContentSha1()
Returns:
the sha1 of the content (does not include the id)


computeStats

java.lang.Object computeStats()


computeStats

java.lang.Object computeStats(java.lang.Object keys)
Computes the stats of this model limited by the set of keys provided.
Returns:
a map containing as the key, the name of the stat and the value is a counter (note that when the value is unique, then the unique value is returned instead of the counter)


each

java.lang.Object each(groovy.lang.Closure closure)


equals

boolean equals(java.lang.Object o)


filter

static java.util.List filter(SystemModel system1, SystemModel system2)
Filters the 2 models in the following way:
Returns:
[system1, system2]


filterBy

SystemModel filterBy(SystemModel system)
Apply all the filters from the provided system model. Note that this call does not filter out entries that are not filtered in provided system (by key).


filterBy

SystemModel filterBy(java.lang.String filter)
The filter is a dsl
Returns:
the filtered model
See Also:
SystemFilterBuilder


filterBy

SystemModel filterBy(SystemFilter filter)
Returns:
a model that has been filtered by the provided filter


filterBy

SystemModel filterBy(groovy.lang.Closure filter)
Parameters:
filter - (will be called for each entry (SystemEntry) and should return true if the entry should be included, false for excluded
Returns:
a model that has been filtered by the provided filter


filterBy

SystemModel filterBy(java.lang.String name, groovy.lang.Closure filter)
Parameters:
filter - (will be called for each entry (SystemEntry) and should return true if the entry should be included, false for excluded
Returns:
a model that has been filtered by the provided filter


filterBy

SystemModel filterBy(java.lang.String name, java.lang.Object value)
This is a shortcut to apply a filter of the style: se."${name}" == value. Note that it properly handles names with a dot (ex: metadata.version will be turned into se.metadata.version (not se."metadata.version")
See Also:
SystemEntry#flatten()#flatten()


filterByMetadata

SystemModel filterByMetadata(java.lang.String name, java.lang.Object value)
This is a shortcut to apply a filter where the metadata matches the value


filterKeys

static java.util.Set filterKeys(SystemModel system1, SystemModel system2)
Filters the 2 models in the following way:
Returns:
the keys


findChildrenKeys

java.util.Collection findChildrenKeys(java.lang.String parentKey)


findEntries

java.util.Collection findEntries()


findEntry

SystemEntry findEntry(java.lang.String agent, java.lang.String mountPoint)


findEntry

SystemEntry findEntry(java.lang.String key)


fromExternalRepresentation

static SystemModel fromExternalRepresentation(java.lang.Object er)


getAgentTags

ReadOnlyTaggeable getAgentTags(java.lang.String agentName)
Returns:
the tags of the given agent


getAgentTags

java.util.Map getAgentTags()
Returns:
all the agent tags


getKeys

T getKeys(T keys)


groupByEntryMetadata

java.lang.Object groupByEntryMetadata(java.lang.String name)
Returns:
a collection with all the unique values for entry.metadata[name]


hashCode

int hashCode()


removeEntry

void removeEntry(java.lang.String key)


toCanonicalRepresentation

java.lang.Object toCanonicalRepresentation()
In the canonical representation, the agent tags are removed from the entry tags


toExternalRepresentation

java.lang.Object toExternalRepresentation()


toExternalRepresentation

java.lang.Object toExternalRepresentation(boolean includeEntries)


toString

java.lang.String toString()


unfilter

SystemModel unfilter()
Returns:
the system as it was unfiltered


updateEntry

void updateEntry(SystemEntry entry)


 

Groovy Documentation