use of org.alfresco.sync.events.types.ContentReadRangeEvent in project alfresco-repository by Alfresco.
the class CMISConnector method publishReadEvent.
/**
* Notifies listeners that a read has taken place.
*
* @param nodeRef NodeRef
* @param name String
* @param mimeType String
* @param contentSize long
* @param encoding String
* @param range String
*/
protected void publishReadEvent(final NodeRef nodeRef, final String name, final String mimeType, final long contentSize, final String encoding, final String range) {
final QName nodeType = nodeRef == null ? null : nodeService.getType(nodeRef);
eventPublisher.publishEvent(new EventPreparator() {
@Override
public Event prepareEvent(String user, String networkId, String transactionId) {
if (StringUtils.hasText(range)) {
return new ContentReadRangeEvent(user, networkId, transactionId, nodeRef.getId(), null, nodeType.toString(), Client.asType(ClientType.cmis), name, mimeType, contentSize, encoding, range);
} else {
return new ContentEventImpl(ContentEvent.DOWNLOAD, user, networkId, transactionId, nodeRef.getId(), null, nodeType.toString(), Client.asType(ClientType.cmis), name, mimeType, contentSize, encoding);
}
}
});
}
Aggregations