Package com.saperion.connector.events
Interface CustomEventBuilder
public interface CustomEventBuilder
A builder for custom integration server events. To obtain a builder and fire a custom event one must be aware of 
 the following parameters.
 
 
- a connection to the saperion system to fire the event
- the name of the custom event
- the attributes of the custom event
EventManager. 
 For this one needs an already authenticated classic connector:
 
 
     EventManager manager = EventManager.newEventManager(myClassicConnector);
     ... 
 EventManager by
 specifying the events name:
 
 
     ...
     CustomEventBuilder builder = manager.newCustomEvent("my.name");  
     ... 
  
     ... 
     builder.setAttribute("key1", "value1");
     builder.setAttribute("key2", "value2");
     builder.setAttribute("key3", "value3");
     builder.setAttribute("key4", "value4");
     ...
  
     ...
     Map<String, String> myStringMap = getMyPreparedAttributes(); 
     builder.addAll(myStringMap);
     ...
 
     ...
     Properties properties = new Properties(); 
     properties.load(myFileReader); 
     builder.addAll(properties); 
     ... 
  
     ... 
     builder.fire(); 
 
     EventManager.newEventManager(myClassicConnector).newCustomEvent("my.name") 
                  .setAttribute("myFirstKey", "myFirstValue").setAttribute("mySecondKey", "mySecondValue").fire(); 
 - 
Method SummaryModifier and TypeMethodDescriptionAdds every entry of the given map as an attributeaddAll(Properties properties) Convenience method to add a properties object as attributes.voidfire()Fires the custom event defined by this builder.setAttribute(String key, String value) Sets an attribute.<SerializableMap extends Map<String,String>, Serializable> 
 CustomEventBuildersetAttributes(SerializableMap map) Discards the attributes given already and uses the given ones instead.
- 
Method Details- 
setAttributeSets an attribute.- Parameters:
- key- the key to store the attribute as
- value- the value of the attribute
- Returns:
- The event builder with the attribute added
 
- 
addAllAdds every entry of the given map as an attribute- Parameters:
- attributes- the attributes to add
- Returns:
- The event builder with the attributes added
 
- 
addAllConvenience method to add a properties object as attributes.- Parameters:
- properties- The properties to add
- Returns:
- The event builder with the properties added as attributes
 
- 
setAttributes<SerializableMap extends Map<String,String>, CustomEventBuilder setAttributesSerializable> (SerializableMap map) Discards the attributes given already and uses the given ones instead.- Parameters:
- map- The attributes to use. Note that they have to be given in a map that implements both- Mapand- CustomEventBuilder
- Returns:
- The event builder with the attributes added
 
- 
fireFires the custom event defined by this builder.
 
-