When implementing a SNMP entity, it is often better to implement the so called "trap directed polling" concept instead of a simple "trap sender". For the latter SNMP4J can be used out-of-the-box, for the first SNMP4J-Agent can be used. This is licensed under the Apache 2 Open Source license as well.
As traps could get lost on the network, the trap-directed-polling approach has many advantages, although it needs more (few) effort to implement the agent part.
Regarding the original question:
- When sending a SET pdu you ask the command responder (agent) to change some information on its entity.
- When sending a TRAP or better NOTIFICATION pdu you want to inform the command generator (manager) about an event. With the trap-directed-polling concept in place, the command generator would also send GET requests regularly (e.g. every 5 minutues) on *LastChanged objects to effeciently detect data changes in certain (crictical) sub-trees of the command responder's MIB. If a change is detected (either through a notification PDU or the polling, the changed data is requested from the comamnd responder by the command generator.