org.apache.ivy.core.event

Class IvyEvent

public class IvyEvent extends Object

The root of all ivy events Any ivy event knows which ivy instance triggered the event (the source) and also has a name and a map of attributes. The name of the event represents the event type, usually there is a one - one mapping between event names and IvyEvent subclass, even if this is not mandatory. Example: pre-resolve pre-resolve-dependency post-download The map of attributes is a Map from String keys to String values. It is especially useful to filter events, and to get some of their essential data in some context where access to Java types is not easy (in an ant build file, for example), Example: pre-resolve (organisation=foo, module=bar, revision=1.0, conf=default) post-download (organisation=foo, module=bar, revision=1.0, artifact=foo-test, type=jar, ext=jar)
Constructor Summary
protected IvyEvent(String name)
Method Summary
protected voidaddAttribute(String key, String value)
Should only be called during event object construction, since events should be immutable
protected voidaddAttributes(Map attributes)
protected voidaddConfsAttribute(String[] confs)
protected voidaddMDAttributes(ModuleDescriptor md)
protected voidaddModuleIdAttributes(ModuleId moduleId)
protected voidaddMridAttributes(ModuleRevisionId mrid)
booleanequals(Object obj)
MapgetAttributes()
Returns the attributes of this event, as a Map(String->String)
StringgetName()
EventManagergetSource()
inthashCode()
StringtoString()

Constructor Detail

IvyEvent

protected IvyEvent(String name)

Method Detail

addAttribute

protected void addAttribute(String key, String value)
Should only be called during event object construction, since events should be immutable

Parameters: key value

addAttributes

protected void addAttributes(Map attributes)

addConfsAttribute

protected void addConfsAttribute(String[] confs)

addMDAttributes

protected void addMDAttributes(ModuleDescriptor md)

addModuleIdAttributes

protected void addModuleIdAttributes(ModuleId moduleId)

addMridAttributes

protected void addMridAttributes(ModuleRevisionId mrid)

equals

public boolean equals(Object obj)

getAttributes

public Map getAttributes()
Returns the attributes of this event, as a Map(String->String)

Returns: the attributes of this event, as a Map(String->String)

getName

public String getName()

getSource

public EventManager getSource()

hashCode

public int hashCode()

toString

public String toString()