ThingWorx Edge Java SDK > Using ThingWorx Platform and the Edge Java SDK > Firing Events
  
Firing Events
While connected to the server, you can trigger an event on a remote thing. The code snippet from the Simple Thing example below shows how to use a ValueCollection to specify the payload of an event, and then trigger a FileEvent on a remote thing.
//
// Firing an event
/////////////////////////////////////////////////////////////

// A ValueCollection is used to specify the payload of
// an event.
ValueCollection payload = new ValueCollection();

payload.put("name", new StringPrimitive("FileName"));
payload.put("path", new StringPrimitive("/file.txt"));
payload.put("fileType", new StringPrimitive("F"));
payload.put("lastModifiedDate", new DatetimePrimitive());
payload.put("size", new NumberPrimitive(256));

// This will trigger the 'FileEvent' of a remote thing
// on the platform.
cient.fireEvent(ThingworxEntityTypes.Things, ThingName,
"FileEvent", payload, 5000);..
You have probably noticed the use of primitives in the Simple Thing examples. It is important to keep in mind that the ThingWorx environment has its own set of primitives for working with data. The primitives are used when populating an INFOTABLE or a ValueCollection, for example. The ThingWorx primitives map to and extend basic Java types. They include some of the Java types, as well as others, such as LOCATION, THINGNAME, IMAGE, and more. For a complete list of the ThingWorx base types/primitives, refer to Base Types and Primitives.
For your own application, you may want offline support for data and caching. This support is possible only with binding. The remote thing on the server must be bound to the websocket over which the client application is communicating. The next section explains how to use binding.