Upgrade to latest oparent
[aaf/authz.git] / authz-batch / src / main / java / com / att / authz / actions / CredDelete.java
1 /*******************************************************************************
2  * Copyright (c) 2016 AT&T Intellectual Property. All rights reserved.
3  *******************************************************************************/
4 package com.att.authz.actions;
5
6 import java.io.IOException;
7
8 import com.att.authz.env.AuthzTrans;
9 import com.att.authz.layer.Result;
10 import com.att.dao.aaf.cass.CredDAO;
11 import org.onap.aaf.inno.env.APIException;
12 import org.onap.aaf.inno.env.util.Chrono;
13 import com.datastax.driver.core.Cluster;
14
15 public class CredDelete extends ActionDAO<CredDAO.Data,Void> {
16         
17         public CredDelete(AuthzTrans trans, Cluster cluster) throws APIException, IOException {
18                 super(trans, cluster);
19         }
20
21         public CredDelete(AuthzTrans trans, ActionDAO<?,?> adao) {
22                 super(trans, adao);
23         }
24
25         @Override
26         public Result<Void> exec(AuthzTrans trans, CredDAO.Data cred) {
27                 Result<Void> rv = q.credDAO.delete(trans, cred, true); // need to read for undelete
28                 trans.info().log("Deleted:",cred.id,CredPrint.type(cred.type),Chrono.dateOnlyStamp(cred.expires));
29                 return rv;
30         }
31 }