summaryrefslogtreecommitdiffstats
path: root/authz-batch/src/main/java/com/att/authz/actions/CredDelete.java
blob: 80c6755cff0bb57ab9cb254ed840f1d09ea7c39d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*******************************************************************************
 * Copyright (c) 2016 AT&T Intellectual Property. All rights reserved.
 *******************************************************************************/
package com.att.authz.actions;

import java.io.IOException;

import com.att.authz.env.AuthzTrans;
import com.att.authz.layer.Result;
import com.att.dao.aaf.cass.CredDAO;
import org.onap.aaf.inno.env.APIException;
import org.onap.aaf.inno.env.util.Chrono;
import com.datastax.driver.core.Cluster;

public class CredDelete extends ActionDAO<CredDAO.Data,Void> {
	
	public CredDelete(AuthzTrans trans, Cluster cluster) throws APIException, IOException {
		super(trans, cluster);
	}

	public CredDelete(AuthzTrans trans, ActionDAO<?,?> adao) {
		super(trans, adao);
	}

	@Override
	public Result<Void> exec(AuthzTrans trans, CredDAO.Data cred) {
		Result<Void> rv = q.credDAO.delete(trans, cred, true); // need to read for undelete
		trans.info().log("Deleted:",cred.id,CredPrint.type(cred.type),Chrono.dateOnlyStamp(cred.expires));
		return rv;
	}
}