@Override public int compareTo(PerunBean perunBean) { if(perunBean == null) throw new NullPointerException("PerunBean to compare with is null."); if(perunBean instanceof Vo) { Vo vo = (Vo) perunBean; if (this.getName() == null && vo.getName() != null) return -1; if (vo.getName() == null && this.getName() != null) return 1; if (this.getName() == null && vo.getName() == null) return 0; return this.getName().compareToIgnoreCase(vo.getName()); } else { return (this.getId() - perunBean.getId()); } }
@Override public String serializeToString() { StringBuilder str = new StringBuilder(); return str.append(this.getClass().getSimpleName()).append(":[").append( "id=<").append(getId()).append(">").append( ", name=<").append(getName() == null ? "\\0" : BeansUtils.createEscaping(getName())).append(">").append( ", shortName=<").append(getShortName() == null ? "\\0" : BeansUtils.createEscaping(getShortName())).append(">").append( ']').toString(); }
mailText = mailText.replace("{voName}", vo.getName());
@Override public ApplicationForm getFormForVo(final Vo vo) throws PerunException { if (vo == null) throw new InternalErrorException("VO can't be null"); try { return jdbc.queryForObject(FORM_SELECT + " where vo_id=? and group_id is null", new RowMapper<ApplicationForm>() { @Override public ApplicationForm mapRow(ResultSet rs, int arg1) throws SQLException { ApplicationForm form = new ApplicationForm(); form.setId(rs.getInt("id")); form.setAutomaticApproval(rs.getBoolean("automatic_approval")); form.setAutomaticApprovalExtension(rs.getBoolean("automatic_approval_extension")); form.setModuleClassName(rs.getString("module_name")); form.setVo(vo); return form; } }, vo.getId()); } catch (EmptyResultDataAccessException ex) { throw new FormNotExistsException("Form for VO: "+vo.getName()+" doesn't exists."); } }
desc+= vo.getName(); writer.write(desc + '\n');
public void createVo(Vo vo) throws InternalErrorException { // Create a set of attributes for vo Attributes voAttributes = new BasicAttributes(); // Create the objectclass to add Attribute voObjClasses = new BasicAttribute(EventProcessorImpl.ldapAttrObjectClass); voObjClasses.add(EventProcessorImpl.objectClassTop); voObjClasses.add(EventProcessorImpl.objectClassOrganization); voObjClasses.add(EventProcessorImpl.objectClassPerunVO); // Add attributes voAttributes.put(voObjClasses); voAttributes.put(EventProcessorImpl.ldapAttrOrganization, vo.getShortName()); voAttributes.put(EventProcessorImpl.ldapAttrDescription, vo.getName()); voAttributes.put(EventProcessorImpl.ldapAttrPerunVoId, String.valueOf(vo.getId())); // Create the entires try { ldapTemplate.bind(getVoDNByVoId(String.valueOf(vo.getId())), null, voAttributes); log.debug("New entry created in LDAP: Vo {}.", vo); } catch (NameNotFoundException e) { throw new InternalErrorException(e); } }
mailText = mailText.replace("{voName}", app.getVo().getName());
Map<LdapOperation, List<Pair<String,String>>> attributes = new HashMap<LdapOperation, List<Pair<String, String>>>(); List<Pair<String,String>> replaceList = new ArrayList<Pair<String, String>>(); replaceList.add(new Pair(ldapAttrDescription,this.vo.getName())); attributes.put(LdapOperation.REPLACE_ATTRIBUTE, replaceList); updateVoAttributes(attributes, this.vo);
throw new AlreadyRegisteredException("You are already member of VO: "+vo.getName()); if (!regs.isEmpty()) { throw new DuplicateRegistrationAttemptException("Initial application for VO: "+vo.getName()+" already exists.", actor, extSourceName, regs.get(0)); throw new DuplicateRegistrationAttemptException("Initial application for VO: "+vo.getName()+" already exists", actor, extSourceName, regs.get(0)); if (!regs.isEmpty()) { throw new DuplicateRegistrationAttemptException("Extension application for VO: " + vo.getName() + " already exists.", actor, extSourceName, regs.get(0));
") has been created with errors. Administrator of " + application.getVo().getName() + " has been notified. If you want, you can use \"Send report to RT\" button to send this information to administrators directly."); log.error("[REGISTRAR] New application {} created with errors {}. This is case of PerunException {}",application, exceptions, ex.getErrorId()); throw ex;