public String retrieveSourcePath() { if (sourceClientId != null) { return sourceClientId.getPath(); } if (sourceOrcid != null) { return sourceOrcid.getPath(); } return null; }
if (other.assertionOriginClientId != null) return false; } else if (!assertionOriginClientId.equals(other.assertionOriginClientId)) return false; if (assertionOriginOrcid == null) { if (other.sourceClientId != null) return false; } else if (!sourceClientId.equals(other.sourceClientId)) return false; if (sourceOrcid == null) {
public String retriveSourceUri() { if (sourceClientId != null) { return sourceClientId.getUri(); } if (sourceOrcid != null) { return sourceOrcid.getUri(); } return null; }
public static Source forClient(String clientId, String oboId) { Source s = forClient(clientId); if (oboId != null) { if (oboId.startsWith("APP-")) { s.setAssertionOriginClientId(new SourceClientId(oboId)); } else { s.setAssertionOriginOrcid(new SourceOrcid(oboId)); } } return s; } }
if(s.getSourceClientId() != null && s.getSourceClientId().getPath() != null) { s.getSourceClientId().setHost(orcidUrlManager.getBaseHost()); s.getSourceClientId().setUri(orcidUrlManager.getBaseUrl() + "/client/" + s.getSourceClientId().getPath()); String sourceNameValue = sourceNameCacheManager.retrieve(s.getSourceClientId().getPath()); if (sourceNameValue != null) { s.setSourceName(new SourceName(sourceNameValue)); if(s.getAssertionOriginClientId() != null && s.getAssertionOriginClientId().getPath() != null) { s.getAssertionOriginClientId().setHost(orcidUrlManager.getBaseHost()); s.getAssertionOriginClientId().setUri(orcidUrlManager.getBaseUrl() + "/client/" + s.getAssertionOriginClientId().getPath()); String sourceNameValue = sourceNameCacheManager.retrieve(s.getAssertionOriginClientId().getPath()); if (sourceNameValue != null) { s.setAssertionOriginName(new SourceName(sourceNameValue));
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((assertionOriginClientId == null) ? 0 : assertionOriginClientId.hashCode()); result = prime * result + ((assertionOriginOrcid == null) ? 0 : assertionOriginOrcid.hashCode()); result = prime * result + ((sourceClientId == null) ? 0 : sourceClientId.hashCode()); result = prime * result + ((sourceOrcid == null) ? 0 : sourceOrcid.hashCode()); return result; }
/** Logic taken from SourceEntity constructor * * @param clientId * @return */ public static Source forClient(String clientId) { Source s = new Source(); if (clientId != null) { if (clientId.startsWith("APP-")) { s.setSourceClientId(new SourceClientId(clientId)); } else { s.setSourceOrcid(new SourceOrcid(clientId)); } } return s; }
/** Utility that copies source ids from entity into new Source model. * */ public static Source extractSourceFromEntity(SourceAwareEntity<?> e) { Source source = new Source(); //orcid if (!StringUtils.isEmpty(e.getSourceId())) source.setSourceOrcid(new SourceOrcid(e.getSourceId())); //client if (!StringUtils.isEmpty(e.getClientSourceId())) source.setSourceClientId(new SourceClientId(e.getClientSourceId())); //obo if (!StringUtils.isEmpty(e.getAssertionOriginSourceId())) source.setAssertionOriginOrcid(new SourceOrcid(e.getAssertionOriginSourceId())); if (!StringUtils.isEmpty(e.getAssertionOriginClientSourceId())) source.setAssertionOriginClientId(new SourceClientId(e.getAssertionOriginClientSourceId())); return source; }
public String retrieveAssertionOriginPath() { if (assertionOriginClientId != null) { return assertionOriginClientId.getPath(); } if (assertionOriginOrcid != null) { return assertionOriginOrcid.getPath(); } return null; }
public String retriveAssertionOriginUri() { if (assertionOriginClientId != null) { return assertionOriginClientId.getUri(); } if (assertionOriginOrcid != null) { return assertionOriginOrcid.getUri(); } return null; }
ClientDetailsEntity clientDetails = clientDetailsManager.findByClientId(clientId); Source source = new Source(); source.setSourceClientId(new SourceClientId(clientId)); source.setSourceName(new SourceName(clientDetails.getClientName())); if (!StringUtils.isEmpty(tokenDetail.getOboClientDetailsId())){ ClientDetailsEntity oboClientDetails = clientDetailsManager.findByClientId(tokenDetail.getOboClientDetailsId()); source.setAssertionOriginClientId(new SourceClientId(oboClientDetails.getClientId())); source.setAssertionOriginName(new SourceName(oboClientDetails.getClientName()));
/** Utility method that copies from model to entity, as entity can't see model and vis-versa. * * @param from * @param to */ @SuppressWarnings("deprecation") public static void populateSourceAwareEntityFromSource(Source from, SourceAwareEntity<?> to) { //Set the source if(from.getSourceOrcid() != null && from.getSourceOrcid().getPath() != null) { to.setSourceId(from.getSourceOrcid().getPath()); } if(from.getSourceClientId() != null && from.getSourceClientId().getPath() != null) { to.setClientSourceId(from.getSourceClientId().getPath()); } //Set the OBO if(from.getAssertionOriginOrcid() != null && from.getAssertionOriginOrcid().getPath() != null) { to.setAssertionOriginSourceId(from.getAssertionOriginOrcid().getPath()); } if(from.getAssertionOriginClientId() != null && from.getAssertionOriginClientId().getPath() != null) { to.setAssertionOriginClientSourceId(from.getAssertionOriginClientId().getPath()); } }
source.setSourceClientId(new SourceClientId(this.getSource())); } else { source.setSourceOrcid(new SourceOrcid(this.getSource()));
source.setSourceClientId(new SourceClientId(this.getSource())); } else { source.setSourceOrcid(new SourceOrcid(this.getSource()));