public static UUID getUuid( EntityRef ref ) { if ( ref == null ) { return null; } return ref.getUuid(); }
/** * @return */ public String getConnectingEntityType() { if ( connectingEntity == null ) { return null; } return connectingEntity.getType(); }
CollectionInfo collection = getDefaultSchema().getCollection( headEntity.getType(), collectionName ); "Cannot find collection-info for '" + collectionName + "' of " + headEntity.getType() + ":" + headEntity .getUuid() ); final Query toExecute = adjustQuery( query ); final Optional<String> queryString = query.isGraphSearch()? Optional.<String>absent(): query.getQl(); final Id ownerId = headEntity.asId(); final boolean analyzeOnly = query.getAnalyzeOnly(); final boolean returnQuery = query.getReturnQuery();
@Override public Set<String> getConnectionsAsSource( final EntityRef entityRef ) { Preconditions.checkNotNull(entityRef, "entityRef cannot be null"); final GraphManager graphManager = graphManagerFactory.createEdgeManager( applicationScope ); final SearchEdgeType searchByEdgeType = createConnectionTypeSearch( entityRef.asId() ); return graphManager.getEdgeTypesFromSource( searchByEdgeType ).map( edgeName -> getConnectionNameFromEdgeName( edgeName ) ) .collect( () -> new HashSet<String>(), ( r, s ) -> r.add( s ) ).toBlocking().last(); }
/** * @return */ public UUID getConnectingEntityId() { if ( connectingEntity == null ) { return null; } return connectingEntity.getUuid(); }
public static String getType( EntityRef ref ) { if ( ref == null ) { return null; } return ref.getType(); } }
@Override public Set<String> getConnectionsAsTarget( final EntityRef entityRef ) { Preconditions.checkNotNull( entityRef, "entityRef cannot be null" ); final GraphManager graphManager = graphManagerFactory.createEdgeManager( applicationScope ); final SearchEdgeType searchByEdgeType = createConnectionTypeSearch( entityRef.asId() ); return graphManager.getEdgeTypesToTarget(searchByEdgeType).map( edgeName -> getConnectionNameFromEdgeName( edgeName ) ) .collect( () -> new HashSet<String>( ), ( r, s ) -> r.add(s) ).toBlocking().last(); }
public String getJobQueueName(EntityRef notification) { return "notifications/" + notification.getUuid(); }
@Override public void doWrite(EntityManager em, FileImport fileImport, FileImportTracker stats) { try { if (logger.isTraceEnabled()) { logger.trace("Adding map to {}:{} dictionary {}", ownerEntityRef.getType(), ownerEntityRef.getType(), dictionaryName); } em.addMapToDictionary(ownerEntityRef, dictionaryName, dictionary); } catch (Exception e) { logger.error("Error writing dictionary. From file: " + fileImport.getFileName(), e); // TODO add statistics for dictionary writes and failures } } }
final Id sourceId = headEntity.asId();
public String getPath( EntityRef entity ) { return request.getPath() + "/" + entity.getUuid().toString(); }
private void validateEntityType( EntityRef item, UUID id ) throws UnexpectedEntityTypeException { if ( !getEntityType().equalsIgnoreCase( item.getType() ) ) { throw new UnexpectedEntityTypeException( "Entity " + id + " is not the expected type, expected " + getEntityType() + ", found " + item .getType() ); } } }
@Override public ConnectionRef connectionRef( EntityRef connectingEntity, String connectionType, EntityRef connectedEntityRef ) throws Exception { return new ConnectionRefImpl( connectingEntity.getType(), connectingEntity.getUuid(), connectionType, connectedEntityRef.getType(), connectedEntityRef.getUuid() ); }
public String getPath( EntityRef entity, String subPath ) { return request.getPath() + "/" + entity.getUuid().toString() + "/" + subPath; }
public Set<String> getCollectionSet( EntityRef ref ) { Set<String> set = Schema.getDefaultSchema().getCollectionNames(ref.getType()); set = new LinkedHashSet<String>( set ); if ( declaredCollections != null ) { set.addAll( declaredCollections ); } if ( privateCollections != null ) { set.removeAll( privateCollections ); } if ( set.size() > 0 ) { return set; } return null; }
public SimpleCollectionRef( EntityRef ownerRef, String collectionName, EntityRef itemRef ) { this.ownerRef = ownerRef; this.collectionName = collectionName; this.itemRef = itemRef; type = itemRef.getType() + ":" + MEMBER_ENTITY_TYPE; id = CassandraPersistenceUtils.keyID( ownerRef.getUuid(), collectionName, itemRef.getUuid() ); }
private Object getRolePermissionsKey( UUID groupId, String roleName ) { try { return CassandraPersistenceUtils .key( getGroupRoleRef( groupId, roleName ).getUuid(), DICTIONARY_PERMISSIONS ); } catch ( Exception e ) { logger.error( "Error creating role key for uuid {} and role {}", groupId, roleName ); return null; } }