All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sap.cds.repackaged.audit.client.impl.DataAccessMessageImpl Maven / Gradle / Ivy

There is a newer version: 3.2.0
Show newest version
package com.sap.cds.repackaged.audit.client.impl;

import java.util.UUID;

import com.sap.cds.repackaged.audit.api.DataAccessAuditMessage;
import com.sap.xs.audit.message.DataAccess;

/**
 * This class implements the main audit log message interfaces, and encapsulates the formating functionality of the
 * audit log messages. This object is not thread safe thus in case of parallel threads its access need to be
 * synchronized.
 * 
 */
@Deprecated
public class DataAccessMessageImpl extends AuditLogMessageImpl implements DataAccessAuditMessage {

	public DataAccessMessageImpl(AuditLogMessageFactoryImpl factory) {
		super(factory);
		this.endpoint = factory.getServiceUrl() + "data-accesses";
		message = new DataAccess();
		message.setUuid(UUID.randomUUID().toString());
	}

	public void setChannel(String channel) {
		ensureNotLogged();
		message.setChannel(channel);
	}

	@Override
	public void setObjectId(String objectId) {
		ensureNotLogged();
		message.setObjectId(objectId);
	}

	@Override
	public void addAttribute(String name, boolean isSuccessful) {
		ensureNotLogged();
		message.addAttribute(name, isSuccessful);
	}

	public void addAttachment(String id, String name) {
		ensureNotLogged();
		message.addAttachment(id, name);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy