@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( ", type=<").append(getType() == null ? "\\0" : BeansUtils.createEscaping(getType())).append(">").append( ']').toString(); }
@Override public int compareTo(PerunBean perunBean) { if(perunBean == null) throw new NullPointerException("PerunBean to compare with is null."); if(perunBean instanceof ExtSource) { ExtSource extSource = (ExtSource) perunBean; int compare; //Compare on last Name if (this.getName()== null && extSource.getName() != null) compare = -1; else if (extSource.getName() == null && this.getName() != null) compare = 1; else if (this.getName() == null && extSource.getName() == null) compare = 0; else compare = this.getName().compareToIgnoreCase(extSource.getName()); if(compare != 0) return compare; //Compare on type if (this.getType()== null && extSource.getType() != null) compare = -1; else if (extSource.getType() == null && this.getType() != null) compare = 1; else if (this.getType()== null && extSource.getType() == null) compare = 0; else compare = this.getType().compareToIgnoreCase(extSource.getType()); if(compare != 0) return compare; //Compare to id if not return (this.getId() - perunBean.getId()); } else { return (this.getId() - perunBean.getId()); } } }
for (UserExtSource ues : u.getUserExtSources()) { if (ues.getExtSource().getType().equals(ExtSourcesManagerEntry.EXTSOURCE_X509)) { es.add(ues.getExtSource()); } else if (ues.getExtSource().getType().equals(ExtSourcesManagerEntry.EXTSOURCE_IDP)) { } else if (ues.getExtSource().getType().equals(ExtSourcesManagerEntry.EXTSOURCE_KERBEROS)) { es.add(ues.getExtSource());
for(UserExtSource ues: userExtSources) { if(ues != null && ues.getExtSource() != null) { String type = ues.getExtSource().getType(); if(type != null) { if(type.equals(ExtSourcesManager.EXTSOURCE_IDP)) {
if(this.userExtSource.getExtSource() != null && this.userExtSource.getExtSource().getType() != null) { String extLogin; if(this.userExtSource.getExtSource().getType().equals(ExtSourcesManager.EXTSOURCE_IDP)) { extLogin = this.userExtSource.getLogin(); if(extLogin == null) extLogin = ""; if(this.userExtSource.getExtSource() != null && this.userExtSource.getExtSource().getType() != null) { String extLogin; if(this.userExtSource.getExtSource().getType().equals(ExtSourcesManager.EXTSOURCE_IDP)) { extLogin = this.userExtSource.getLogin(); if(extLogin == null) extLogin = "";
" and a.created_by=? and a.extsourcename=? and a.extsourcetype=?", APP_MAPPER, vo.getId(), AppState.VERIFIED.toString(), ue.getLogin(), ue.getExtSource().getName(), ue.getExtSource().getType());