use of com.evolveum.midpoint.notifications.api.events.CertCampaignEvent in project midpoint by Evolveum.
the class CertificationListener method onCampaignEnd.
@Override
public void onCampaignEnd(AccessCertificationCampaignType campaign, Task task, OperationResult result) {
CertCampaignEvent event = certEventFactory.createOnCampaignEndEvent(campaign, task, result);
processEvent(event, task, result);
}
use of com.evolveum.midpoint.notifications.api.events.CertCampaignEvent in project midpoint by Evolveum.
the class CertificationListener method onCampaignStart.
@Override
public void onCampaignStart(AccessCertificationCampaignType campaign, Task task, OperationResult result) {
CertCampaignEvent event = certEventFactory.createOnCampaignStartEvent(campaign, task, result);
processEvent(event, task, result);
}
use of com.evolveum.midpoint.notifications.api.events.CertCampaignEvent in project midpoint by Evolveum.
the class CertEventFactory method createOnCampaignStartEvent.
public CertCampaignEvent createOnCampaignStartEvent(AccessCertificationCampaignType campaign, Task task, OperationResult result) {
CertCampaignEvent event = new CertCampaignEvent(idGenerator, campaign, EventOperationType.ADD);
fillInEvent(campaign, task, event);
return event;
}
use of com.evolveum.midpoint.notifications.api.events.CertCampaignEvent in project midpoint by Evolveum.
the class SimpleCampaignNotifier method getBody.
@Override
protected String getBody(Event event, GeneralNotifierType generalNotifierType, String transport, Task task, OperationResult result) {
StringBuilder body = new StringBuilder();
CertCampaignEvent campaignEvent = (CertCampaignEvent) event;
AccessCertificationCampaignType campaign = campaignEvent.getCampaign();
body.append("Campaign ");
body.append(certHelper.getCampaignNameAndOid(campaignEvent));
body.append(" was ");
if (campaignEvent.isAdd()) {
body.append("STARTED");
} else if (campaignEvent.isDelete()) {
body.append("CLOSED");
} else {
throw new IllegalStateException("Unexpected campaign event type: neither ADD nor DELETE");
}
body.append(".\n\n");
// the event is generated in the real time
body.append("Time: ").append(new Date());
body.append("\nRequester: ").append(formatRequester(event, result));
body.append("\nOperation status: ").append(certHelper.formatStatus(campaignEvent));
body.append("\n\nCurrent state: ").append(certHelper.formatState(campaignEvent));
body.append("\n\n");
certHelper.appendStatistics(body, campaign, task, result);
body.append("\n\n");
functions.addRequesterAndChannelInformation(body, event, result);
return body.toString();
}
use of com.evolveum.midpoint.notifications.api.events.CertCampaignEvent in project midpoint by Evolveum.
the class CertEventFactory method createOnCampaignEndEvent.
public CertCampaignEvent createOnCampaignEndEvent(AccessCertificationCampaignType campaign, Task task, OperationResult result) {
CertCampaignEvent event = new CertCampaignEvent(idGenerator, campaign, EventOperationType.DELETE);
fillInEvent(campaign, task, event);
return event;
}
Aggregations