protected Key keyForInteraction(Interaction interaction) { final Key key = new Key(new CrcCalculator().crc64(interaction)); // pre-calculate the keys for the components here and put them in a map int n = 0; for (Component component : interaction.getComponents()) { Key compKey = new Key(key.getUniqueString() + ":" + component.getShortLabel() + "[" + n + "]"); keyCache.put(Component.class.getSimpleName() + ":" + System.identityHashCode(component), compKey); n++; } return key; }
private Role synchronizeRole( Role role ) { Key key = new Key("role:"+role.getName()); if (synched.containsKey(key)) { return (Role) synched.get(key); } synched.put(key, role); return role; }
if (!key.equals(keyAfter)) { if (ao.getAc() == null) { log.warn(ao.getClass().getSimpleName()+" without AC changed its synchronization Key: "+key+" -> "+keyAfter);
private Role synchronizeRole( Role role ) { Key key = new Key("role:"+role.getName()); if (synched.containsKey(key)) { return (Role) synched.get(key); } synched.put(key, role); return role; }
if (!key.equals(keyAfter)) { if (ao.getAc() == null) { log.warn(ao.getClass().getSimpleName()+" without AC changed its synchronization Key: "+key+" -> "+keyAfter);
protected Key keyForInteraction(Interaction interaction) { final Key key = new Key(new CrcCalculator().crc64(interaction)); // pre-calculate the keys for the components here and put them in a map int n = 0; for (Component component : interaction.getComponents()) { Key compKey = new Key(key.getUniqueString() + ":" + component.getShortLabel() + "[" + n + "]"); keyCache.put(Component.class.getSimpleName() + ":" + System.identityHashCode(component), compKey); n++; } return key; }
protected Key keyForAnnotatedObject(AnnotatedObject annotatedObject) { Class normalizedClass = CgLibUtil.removeCglibEnhanced(annotatedObject.getClass()); return new Key(normalizedClass.getSimpleName() + ":" + annotatedObject.getShortLabel()); }
public Key keyForXref(Xref xref) { return new Key(keyFor(xref.getParent()).getUniqueString() + "::" + xref.getPrimaryId()); }
protected Key keyForAnnotatedObject(AnnotatedObject annotatedObject) { Class normalizedClass = CgLibUtil.removeCglibEnhanced(annotatedObject.getClass()); return new Key(normalizedClass.getSimpleName() + ":" + annotatedObject.getShortLabel()); }
public Key keyForAnnotation(Annotation annotation, AnnotatedObject parent) { return new Key(keyFor(parent).getUniqueString() + "::" + annotation.getCvTopic() + "_" + annotation.getAnnotationText()); }
protected Key keyForBioSource(BioSource bioSource) { StringBuilder sb = new StringBuilder(256); sb.append("BioSource:").append(bioSource.getTaxId()); if (bioSource.getCvCellType() != null) { sb.append("|").append(bioSource.getCvCellType().getIdentifier()); } if (bioSource.getCvTissue() != null) { sb.append("|").append(bioSource.getCvTissue().getIdentifier()); } return new Key(sb.toString()); }
public Key keyForXref(Xref xref) { return new Key(keyFor(xref.getParent()).getUniqueString() + "::" + xref.getPrimaryId()); }
protected Key keyForInteractor(Interactor interactor) { final Collection<InteractorXref> interactorXrefs = XrefUtils.getIdentityXrefs(interactor); Key key; if (interactorXrefs.isEmpty()) { key = keyForAnnotatedObject(interactor); } else { Class normalizedClass = CgLibUtil.removeCglibEnhanced(interactor.getClass()); key = new Key(normalizedClass.getSimpleName() + ":" + concatPrimaryIds(interactorXrefs)); } return key; }
public Key keyForAnnotation(Annotation annotation, AnnotatedObject parent) { return new Key(keyFor(parent).getUniqueString() + "::" + annotation.getCvTopic() + "_" + annotation.getAnnotationText()); }
protected Key keyForBioSource(BioSource bioSource) { StringBuilder sb = new StringBuilder(256); sb.append("BioSource:").append(bioSource.getTaxId()); if (bioSource.getCvCellType() != null) { sb.append("|").append(bioSource.getCvCellType().getIdentifier()); } if (bioSource.getCvTissue() != null) { sb.append("|").append(bioSource.getCvTissue().getIdentifier()); } return new Key(sb.toString()); }
public Key keyForAlias(Alias alias) { return new Key(keyFor(alias.getParent()).getUniqueString() + "::" + alias.getName()); }
protected Key keyForInteractor(Interactor interactor) { final Collection<InteractorXref> interactorXrefs = XrefUtils.getIdentityXrefs(interactor); Key key; if (interactorXrefs.isEmpty()) { key = keyForAnnotatedObject(interactor); } else { Class normalizedClass = CgLibUtil.removeCglibEnhanced(interactor.getClass()); key = new Key(normalizedClass.getSimpleName() + ":" + concatPrimaryIds(interactorXrefs)); } return key; }
public Key keyForAlias(Alias alias) { return new Key(keyFor(alias.getParent()).getUniqueString() + "::" + alias.getName()); }
protected Key keyForInstitution(Institution institution) { final Collection<InstitutionXref> institutionXrefs = XrefUtils.getIdentityXrefs(institution); Key key; if (institutionXrefs.isEmpty()) { key = keyForAnnotatedObject(institution); } else { key = new Key("Institution:" + concatPrimaryIds(institutionXrefs)); } return key; }
protected Key keyForComponent(Component component) { final String cacheKey = Component.class.getSimpleName() + ":" + System.identityHashCode(component); Key interactionKey = null; if (!keyCache.containsKey(cacheKey)) { if (component.getInteraction() == null) { throw new IllegalArgumentException("Cannot generate a key for a component without interaction: " + component); } interactionKey = keyForInteraction(component.getInteraction()); } if (keyCache.containsKey(cacheKey)) { return keyCache.get(cacheKey); } if (interactionKey != null) { Key compKey = new Key(interactionKey.getUniqueString() + ":" + component.getShortLabel() + "[" + component.hashCode() + "]"); keyCache.put(cacheKey, compKey); return compKey; } throw new IllegalStateException("This component should already have already a key, generated when the interaction key is generated: " + component); }