int caid = ((Integer) cadata.getCAId()).intValue();
int caid = ((Integer) cadata.getCaId()).intValue();
    public void renameCA(Admin admin, String oldname, String newname) throws CAExistsException, AuthorizationDeniedException{        // Get CA from database        try{            CADataLocal cadata = cadatahome.findByName(oldname);            // Check authorization            int caid = ((Integer) cadata.getCAId()).intValue();            try{                getAuthorizationSession().isAuthorizedNoLog(admin,"/super_administrator");            }catch(AuthorizationDeniedException e){                getLogSession().log(admin, caid, LogEntry.MODULE_CA,  new java.util.Date(), null, null, LogEntry.EVENT_ERROR_NOTAUTHORIZEDTORESOURCE,"Administrator isn't authorized to rename CA",e);                throw new AuthorizationDeniedException("Not authorized to rename CA with caid = " + caid);            }            try{                CADataLocal cadatanew = cadatahome.findByName(newname);                cadatanew.getCAId();                throw new CAExistsException(" CA name " + newname + " already exists.");            }catch(javax.ejb.FinderException fe) {                // new CA doesn't exits, it's ok to rename old one.                cadata.setName(newname);                getLogSession().log(admin, caid, LogEntry.MODULE_CA,  new java.util.Date(), null, null, LogEntry.EVENT_INFO_CAEDITED,"CA : " + oldname + " renamed to " + newname);            }        }catch(javax.ejb.FinderException fe) {            getLogSession().log(admin, admin.getCAId(), LogEntry.MODULE_CA,  new java.util.Date(), null, null, LogEntry.EVENT_ERROR_CAEDITED,"Error when trying to rename CA.");            throw new EJBException(fe);        }    } // renewCA