@Override public int hashCode() { int hash = 7; hash = 53 * hash + this.getId(); hash = 53 * hash + (this.name != null ? this.name.hashCode() : 0); hash = 53 * hash + (this.shortName != null ? this.shortName.hashCode() : 0); return hash; }
@Override public String toString() { StringBuilder str = new StringBuilder(); return str.append(this.getClass().getSimpleName()).append(":[").append( "id='").append(this.getId()).append('\'').append( ", name='").append(name).append('\'').append( ", shortName='").append(shortName).append('\'').append( ']').toString(); }
@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(); }
public void updateVo(Vo vo, ModificationItem[] modificationItems) { ldapTemplate.modifyAttributes(getVoDNByVoId(String.valueOf(vo.getId())), modificationItems); log.debug("Entry modified in LDAP: Vo {}.", vo); }
public void deleteVo(Vo vo) throws InternalErrorException { try { ldapTemplate.unbind(getVoDNByVoId(String.valueOf(vo.getId()))); log.debug("Entry deleted from LDAP: Vo {}.", vo); } catch (NameNotFoundException e) { throw new InternalErrorException(e); } }
public static Attribute getAttribute(RpcCaller rpcCaller, Vo vo, String attributeName) throws PrivilegeException, InternalErrorException, AttributeNotExistsException, VoNotExistsException, WrongAttributeAssignmentException { Map<String, Object> params = new HashMap<String, Object>(); params.put("vo", vo.getId()); params.put("attributeName", attributeName); try { return rpcCaller.call("attributesManager", "getAttribute", params).read(Attribute.class); } catch (AttributeNotExistsException e) { throw e; } catch (PrivilegeException e) { throw e; } catch (InternalErrorException e) { throw e; } catch (VoNotExistsException e) { throw e; } catch (WrongAttributeAssignmentException e) { throw e; } catch (PerunException e) { throw new ConsistencyErrorException(e); } }
public MailForVoIdUpdated(ApplicationMail mail, Vo vo) { this.mail = mail; this.vo = vo; this.message = formatMessage("Mail ID: %d of Type: %s/%s updated for VO ID: %d.", mail.getId(), mail.getMailType(), mail.getAppType(), vo.getId()); }
public MailForVoIdRemoved(ApplicationMail mail, Vo vo) { this.mail = mail; this.vo = vo; this.message = formatMessage("Mail ID: %d of Type: %s/%s removed for VO ID: %d.", mail.getId(), mail.getMailType(), mail.getAppType(), vo.getId()); }
public MailForVoIdAdded(ApplicationMail mail, Vo vo) { this.mail = mail; this.vo = vo; this.message = formatMessage("Mail ID: %d of Type: %s/%s added for VO ID: %d.", mail.getId(), mail.getMailType(), mail.getAppType(), vo.getId()); }
@Override public void createApplicationFormInVo(PerunSession sess, Vo vo) throws InternalErrorException, PrivilegeException { if (!AuthzResolver.isAuthorized(sess, Role.VOADMIN, vo)) { throw new PrivilegeException(sess, "createApplicationFormInVo"); } int id = Utils.getNewId(jdbc, "APPLICATION_FORM_ID_SEQ"); try { jdbc.update("insert into application_form(id, vo_id) values (?,?)", id, vo.getId()); } catch (DuplicateKeyException ex) { throw new ConsistencyErrorException("VO can have defined only one application form. Can't insert another.", ex); } }
@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()); } }
public ApplicationDeleted(Application app) { this.app = app; this.message = formatMessage("Application ID=%d voID=%d %s has been deleted", app.getId(), app.getVo().getId(), ((app.getGroup() != null) ? (" groupID=" + app.getGroup().getId()) : "")); }
public FormItemAdded(ApplicationForm form) { this.form = form; this.message = formatMessage("Application form item ID=%d voID=%d %s has been added", form.getId(), form.getVo().getId(), ((form.getGroup() != null) ? " groupID=" + form.getGroup().getId() : "")); }
public FormItemDeleted(ApplicationForm form) { this.form = form; this.message = formatMessage("Application form item ID=%d voID=%d %s has been deleted", form.getId(), form.getVo().getId(), ((form.getGroup() != null) ? " groupID=" + form.getGroup().getId() : "")); }
public ApplicationApproved(Application app) { this.app = app; this.message = formatMessage("Application ID=%d voID=%d %s was approved.", app.getId(), app.getVo().getId(), ((app.getGroup() != null) ? (" groupID=" + app.getGroup().getId()) : "")); }
public FormUpdated(ApplicationForm form) { this.form = form; this.message = formatMessage("Application form ID=%d voID=%d %s has been updated.", form.getId(), form.getVo().getId(), ((form.getGroup() != null) ? " groupID=" + form.getGroup().getId() : "")); }
public ApplicationVerified(Application app) { this.app = app; this.message = formatMessage("Application ID=%d voID=%d %s has been verified.", app.getId(), app.getVo().getId(), ((app.getGroup() != null) ? (" groupID=" + app.getGroup().getId()) : "")); }
public ApplicationRejected(Application application) { this.app = application; this.message = formatMessage("Application ID=%d voID=%d %s has been rejected.", app.getId(), app.getVo().getId(), ((app.getGroup() != null) ? (" groupID=" + app.getGroup().getId()) : "")); }
public FormItemsUpdated(ApplicationForm form) { this.form = form; this.message = formatMessage("Application form ID=%d voID=%d %s has had its items updated.", form.getId(), form.getVo().getId(), ((form.getGroup() != null) ? " groupID=" + form.getGroup().getId() : "")); }
public FormItemUpdated(ApplicationForm form, ApplicationFormItem item) { this.form = form; this.item = item; this.message = formatMessage("Application form ID=%d voID=%d %s has had it itemID=%d updated.", form.getId(), form.getVo().getId(), ((form.getGroup() != null) ? " groupID=" + form.getGroup().getId() : ""), item.getId()); }