public EntityRef getApplicationRef() { return ref( Application.ENTITY_TYPE, applicationId ); }
/** * @param connectingEntityType * @param connectingEntityId * @param connectionType * @param connectedEntityType * @param connectedEntityId */ public ConnectionRefImpl( String connectingEntityType, UUID connectingEntityId, String connectionType, String connectedEntityType, UUID connectedEntityId ) { connectingEntity = ref( connectingEntityType, connectingEntityId ); pairedConnections = Collections.emptyList(); connectedEntity = new ConnectedEntityRefImpl( connectionType, connectedEntityType, connectedEntityId ); }
/** * */ public ConnectionRefImpl() { connectingEntity = SimpleEntityRef.ref(); pairedConnections = Collections.emptyList(); connectedEntity = new ConnectedEntityRefImpl(); }
/** Create a connection from the source to the target entity */ public ConnectionRefImpl( EntityRef source, String connectionType, EntityRef target ) { this.connectingEntity = ref( source ); pairedConnections = Collections.emptyList(); this.connectedEntity = new ConnectedEntityRefImpl( connectionType, target ); }
public ConnectionRefImpl( EntityRef connectingEntity, ConnectedEntityRef... connections ) { this.connectingEntity = ref( connectingEntity ); ConnectedEntityRef ce = new ConnectedEntityRefImpl(); List<ConnectedEntityRef> pc = Collections.emptyList(); if ( connections.length > 0 ) { ce = connections[connections.length - 1]; if ( connections.length > 1 ) { pc = Arrays.asList( Arrays.copyOfRange( connections, 0, connections.length - 2 ) ); } } pairedConnections = pc; connectedEntity = ce; }
public static Results fromIdList( List<UUID> l, String type ) { if ( type == null ) { return fromIdList( l ); } List<EntityRef> refs = new ArrayList<EntityRef>(); for ( UUID u : l ) { refs.add( ref( type, u ) ); } Results r = new Results(); r.setRefs(refs); return r; }
@JsonSerialize(include = Inclusion.NON_NULL) public EntityRef getRef() { if ( ref != null ) { return ref; } ref = getEntity(); if ( ref != null ) { return ref; } UUID u = getId(); if ( u != null ) { String type= null; if(refs!=null && refs.size()>0){ type = refs.get(0).getType(); } return ref( type,u ); } return null; }
/** @return connection index id */ public static UUID getIndexId( UUID connectingEntityId, String pairedConnectionType, UUID pairedConnectingEntityId, String connectionType, String connectedEntityType ) { EntityRef connectingEntity = ref( connectingEntityId ); ConnectedEntityRef[] pairedConnections = getConnections( new ConnectedEntityRefImpl( pairedConnectionType, null, pairedConnectingEntityId ) ); return getIndexId( connectingEntity, connectionType, connectedEntityType, pairedConnections ); }
/** @return connection index id */ public static UUID getIndexId( int variant, UUID connectingEntityId, String pairedConnectionType, UUID pairedConnectingEntityId, String connectionType, String connectedEntityType ) { EntityRef connectingEntity = ref( connectingEntityId ); ConnectedEntityRef[] pairedConnections = getConnections( new ConnectedEntityRefImpl( pairedConnectionType, null, pairedConnectingEntityId ) ); return getIndexId( variant, connectingEntity, connectionType, connectedEntityType, pairedConnections ); }
/** * Connection id is constructed from packed structure of properties strings are truncated to 16 ascii bytes. * Connection id is now MD5'd into a UUID via UUID.nameUUIDFromBytes() so, technically string concatenation could be * used prior to MD5 * * @return connection id */ public static UUID getId( UUID connectingEntityId, String pairedConnectionType, UUID pairedConnectingEntityId, String connectionType, UUID connectedEntityId ) { EntityRef connectingEntity = ref( connectingEntityId ); ConnectedEntityRef[] pairedConnections = getConnections( new ConnectedEntityRefImpl( pairedConnectionType, null, pairedConnectingEntityId ) ); ConnectedEntityRef connectedEntity = new ConnectedEntityRefImpl( connectionType, null, connectedEntityId ); return getId( connectingEntity, connectedEntity, pairedConnections ); }