Package app.ductape.sdk.graph
Class GraphService
java.lang.Object
app.ductape.sdk.graph.GraphService
Graph operations facade; tracks
sdk/ts/src/graph/graphs.service.ts (see PARITY_MAP.md +
PARITY_ROADMAP.md § Graph for Redisson-native processJob and adapter depth).-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classTSgraphs.service.ts#get action().dispatch— predefined graph-action jobs taggedgraph-action:{graph}:{event}(vsGraphService.GraphActionDispatchSubsystem.dispatch(java.util.Map<java.lang.String, java.lang.Object>)for raw graph-operation jobs).protected static enumMirrors TSgraph.dispatchvsgraph.action.dispatch. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringWhenBoolean.TRUE,dispatch(java.util.Map<java.lang.String, java.lang.Object>)runs TS-likefetchJob/createJobviaProductsService.ensureGraphOperationJobForDispatch(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map<java.lang.String, java.lang.Object>, long)before the processor hook (requires reachable Products API).static final StringWhenBoolean.TRUE,dispatch(java.util.Map<java.lang.String, java.lang.Object>)POSTs a TS-like job execution record (seeProcessorApiService.createJobExecution(java.util.Map<java.lang.String, java.lang.Object>, app.ductape.sdk.core.RequestContext)) after building processor input.static final StringWhenBoolean.TRUE,dispatch(java.util.Map<java.lang.String, java.lang.Object>)/dispatchGraphAction(java.util.Map<java.lang.String, java.lang.Object>)execute the graph operation (or graph-action) **synchronously** on the connected adapter, mirroring TSprocessorService.processJob+ worker behavior for the operation surface when no Redisson queue is configured. -
Constructor Summary
ConstructorsConstructorDescriptionGraphService(EnvType env, RequestContext auth) GraphService(EnvType env, RequestContext auth, ProductsService productsService) GraphService(EnvType env, RequestContext auth, ProductsService productsService, ProcessorApiService processorApi) -
Method Summary
Modifier and TypeMethodDescriptionaction()TSaddLabels: options includeidandlabels.beginTransaction(Map<String, Object> options) buildGraphJobProcessorInput(Map<String, Object> data, Map<String, Object> schedule, String jobTag, long startAt) TSIJobProcessorInputfields used by graph dispatch.voidcloseAll()voidcommitTransaction(Map<String, Object> transaction) countNodes(Map<String, Object> options) TSICountNodesResult:{ count }.countRelationships(Map<String, Object> options) TSICountRelationshipsResult:{ count }.voidcreateAction(Map<String, Object> options, String productTag) createNode(Map<String, Object> options) createNodeConstraint(Map<String, Object> options) createNodeIndex(Map<String, Object> options) createRelationship(Map<String, Object> options) createRelationshipIndex(Map<String, Object> options) voidvoiddeleteAction(String actionTag, String graphTag, String productTag) deleteNode(Map<String, Object> options) deleteRelationship(Map<String, Object> options) voidTSgraphs.service.ts#dispatch: schedule semantics,graph-operation:{graph}:{operation}job tag,prepareGraphDispatchJob(app.ductape.sdk.graph.GraphService.ScheduledGraphDispatchChannel, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map<java.lang.String, java.lang.Object>, java.util.Map<java.lang.String, java.lang.Object>, long)thendispatchGraphProcessorJob(java.lang.String, java.util.Map<java.lang.String, java.lang.Object>, app.ductape.sdk.graph.GraphService.ScheduledGraphDispatchChannel)with TS-shaped processor input, thenjob_id/status payload.dispatchGraphAction(Map<String, Object> data) Direct Java alias for TSgraph.action.dispatchwhen fluentaction()is not desirable.protected voiddispatchGraphProcessorJob(String jobId, Map<String, Object> jobInput, GraphService.ScheduledGraphDispatchChannel dispatchChannel) TS:processorService.processJob(jobInput).dropConstraint(String constraintName) TSdropConstraint(name: string)after connect.dropConstraint(Map<String, Object> options) TSdropIndex(name: string)after connect.TS drop index — resolvesnameor legacyindexkey after context merge.TS convenience entry whereexecutemaps to predefined graph-action execution (parallel to TS overloads).executeAction(Map<String, Object> options) <T> TTSgraph.executeTransaction(cb, txnOptions)analogue — executes withinGraphTransactionManagerbegin/commit rollback semantics for the resolved connection adapter.fetchAllGraphs(String productTag) fetchConfig(String productTag, String graphTag) fetchConfigs(String productTag) fetchGraphByTag(String productTag, String graphTag) findConnectedComponents(Map<String, Object> options) findNodeById(Object id) TSfindNodeById(id)ergonomic form afterconnect(Map)— product/graph/env are merged from current context.findNodeById(Map<String, Object> options) TSfindNodeById— expectsidplus connection context (graph,env, …).Same asfindRelationshipById(Map)with only an id once connected.findRelationshipById(Map<String, Object> options) TSfindRelationshipById.findRelationships(Map<String, Object> options) fullTextSearch(Map<String, Object> options) TSfullTextSearch/IFullTextSearchResult.getNeighborhood(Map<String, Object> options) getSchemaSnapshot(String productTag, String env, String graphTag) TSIGraphStatistics:nodeCount,relationshipCount, optionalnodesByLabel,relationshipsByType.listActions(String graphTag, String productTag) mergeRelationship(Map<String, Object> options) protected voidprepareGraphDispatchJob(GraphService.ScheduledGraphDispatchChannel dispatchChannel, String productTag, String graph, String logicalName, String jobTag, Map<String, Object> dispatchData, Map<String, Object> schedule, long startAt) TS:productBuilder.fetchJob/createJobbeforeprocessJob.processGraphActionJob(Map<String, Object> data) Worker-side entry point forgraph_actionjobs claimed off the Redisson queue.processGraphOperationJob(Map<String, Object> data) Worker-side entry point forgraph_operationjobs claimed off the Redisson queue.processProcessorJob(GraphService.ScheduledGraphDispatchChannel channel, Map<String, Object> data) TSquery()/IRawQueryResult:records, optionalsummary.removeLabels(Map<String, Object> options) voidrollbackTransaction(Map<String, Object> transaction) voidsetGraphJobQueueAdapter(JobsService.JobQueueAdapter graphJobQueueAdapter) Redisson-native queue hook used byDuctape.voidsetLogApiService(LogApiService logApiService) TS parity: setting aLogApiServiceenables structured connect-log emission (Graph connect - initiated/success/failed) with theGRAPH_CONNECT_LOG_DEBOUNCE_MS(15s) suppression window.voidsetRuntimeDefaults(RuntimeDefaults runtimeDefaults) shortestPath(Map<String, Object> options) booleansupportsFeature(GraphTypes.GraphFeature feature) booleansupportsFeature(String feature) testConnection(Map<String, Object> config) TStraverse()/ITraverseResult.voidTSgraphs.service.ts#update: persist via product API whenproductTagis set, merge intolocalConfigs, and refresh active connection contexts when envs change.updateAction(Map<String, Object> options, String productTag) voidupdateConfig(Map<String, Object> config) updateNode(Map<String, Object> options) updateRelationship(Map<String, Object> options) vectorSearch(Map<String, Object> options) TSvectorSearch/IVectorSearchResult.
-
Field Details
-
CONFIG_ENSURE_GRAPH_JOBS
WhenBoolean.TRUE,dispatch(java.util.Map<java.lang.String, java.lang.Object>)runs TS-likefetchJob/createJobviaProductsService.ensureGraphOperationJobForDispatch(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map<java.lang.String, java.lang.Object>, long)before the processor hook (requires reachable Products API).- See Also:
-
CONFIG_RECORD_JOB_EXECUTION
WhenBoolean.TRUE,dispatch(java.util.Map<java.lang.String, java.lang.Object>)POSTs a TS-like job execution record (seeProcessorApiService.createJobExecution(java.util.Map<java.lang.String, java.lang.Object>, app.ductape.sdk.core.RequestContext)) after building processor input.- See Also:
-
CONFIG_SYNCHRONOUS_GRAPH_DISPATCH
WhenBoolean.TRUE,dispatch(java.util.Map<java.lang.String, java.lang.Object>)/dispatchGraphAction(java.util.Map<java.lang.String, java.lang.Object>)execute the graph operation (or graph-action) **synchronously** on the connected adapter, mirroring TSprocessorService.processJob+ worker behavior for the operation surface when no Redisson queue is configured. Requires an activeconnect(Map)with matching product/graph/env. Production Bolt graphs useNeo4jBoltGraphAdapterwhenconnectionUrlis a Bolt/Neo4j URI.- See Also:
-
-
Constructor Details
-
GraphService
-
GraphService
-
GraphService
public GraphService(EnvType env, RequestContext auth, ProductsService productsService, ProcessorApiService processorApi)
-
-
Method Details
-
updateConfig
-
setLogApiService
TS parity: setting aLogApiServiceenables structured connect-log emission (Graph connect - initiated/success/failed) with theGRAPH_CONNECT_LOG_DEBOUNCE_MS(15s) suppression window. -
setRuntimeDefaults
-
getCurrentContext
-
getConfig
-
setGraphJobQueueAdapter
Redisson-native queue hook used byDuctape. When configured,dispatch(Map)/dispatchGraphAction(Map)enqueue graph processor jobs to the shared jobs queue instead of relying only on the local synchronous hook. -
create
-
fetchConfigs
-
fetchConfig
-
fetchAllGraphs
-
fetchGraphByTag
-
fetchAll
-
fetch
-
update
TSgraphs.service.ts#update: persist via product API whenproductTagis set, merge intolocalConfigs, and refresh active connection contexts when envs change. -
delete
-
connect
-
testConnection
-
disconnect
public void disconnect() -
closeAll
public void closeAll() -
createNode
-
findNodes
-
updateNode
-
deleteNode
-
mergeNode
-
createRelationship
-
findRelationships
-
updateRelationship
-
deleteRelationship
-
mergeRelationship
-
countNodes
TSICountNodesResult:{ count }. -
countRelationships
TSICountRelationshipsResult:{ count }. -
getStatistics
TSIGraphStatistics:nodeCount,relationshipCount, optionalnodesByLabel,relationshipsByType. -
query
-
rawQuery
TSquery()/IRawQueryResult:records, optionalsummary. -
traverse
TStraverse()/ITraverseResult. -
listLabels
-
listRelationshipTypes
-
listIndexes
-
listConstraints
-
findNodeById
TSfindNodeById— expectsidplus connection context (graph,env, …). -
findRelationshipById
TSfindRelationshipById. -
findNodeById
TSfindNodeById(id)ergonomic form afterconnect(Map)— product/graph/env are merged from current context. -
findRelationshipById
Same asfindRelationshipById(Map)with only an id once connected. -
addLabels
TSaddLabels: options includeidandlabels. -
removeLabels
-
setLabels
-
createNodeIndex
-
createNodeConstraint
-
createRelationshipIndex
-
dropIndex
TS drop index — resolvesnameor legacyindexkey after context merge. -
dropConstraint
-
dropIndex
TSdropIndex(name: string)after connect. -
dropConstraint
TSdropConstraint(name: string)after connect. -
shortestPath
-
allPaths
-
getNeighborhood
-
findConnectedComponents
-
fullTextSearch
TSfullTextSearch/IFullTextSearchResult. -
vectorSearch
TSvectorSearch/IVectorSearchResult. -
getSchemaSnapshot
-
getSchemaSnapshot
-
createAction
-
listActions
-
getAction
-
updateAction
-
deleteAction
-
executeAction
-
execute
TS convenience entry whereexecutemaps to predefined graph-action execution (parallel to TS overloads). -
action
-
dispatchGraphAction
Direct Java alias for TSgraph.action.dispatchwhen fluentaction()is not desirable. -
dispatch
TSgraphs.service.ts#dispatch: schedule semantics,graph-operation:{graph}:{operation}job tag,prepareGraphDispatchJob(app.ductape.sdk.graph.GraphService.ScheduledGraphDispatchChannel, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map<java.lang.String, java.lang.Object>, java.util.Map<java.lang.String, java.lang.Object>, long)thendispatchGraphProcessorJob(java.lang.String, java.util.Map<java.lang.String, java.lang.Object>, app.ductape.sdk.graph.GraphService.ScheduledGraphDispatchChannel)with TS-shaped processor input, thenjob_id/status payload. Optional integrations:CONFIG_ENSURE_GRAPH_JOBS,CONFIG_RECORD_JOB_EXECUTION(see hooks below). -
prepareGraphDispatchJob
protected void prepareGraphDispatchJob(GraphService.ScheduledGraphDispatchChannel dispatchChannel, String productTag, String graph, String logicalName, String jobTag, Map<String, Object> dispatchData, Map<String, Object> schedule, long startAt) TS:productBuilder.fetchJob/createJobbeforeprocessJob. WhenCONFIG_ENSURE_GRAPH_JOBSis true, delegates to graph-action / graph-operation job upserts per channel; otherwise no-op. -
dispatchGraphProcessorJob
protected void dispatchGraphProcessorJob(String jobId, Map<String, Object> jobInput, GraphService.ScheduledGraphDispatchChannel dispatchChannel) TS:processorService.processJob(jobInput). In Java, this is Redisson-native when aJobsService.JobQueueAdapteris configured: dispatch builds the same graph worker payload TS enqueues, thenProcessorService.runJobs(java.util.Map<java.lang.String, java.lang.Object>, java.util.Map<java.lang.String, java.lang.Object>)calls#processProcessorJob(Map)to execute it. Without a queue adapter, the optional synchronous config preserves the local/no-Redis test path.- Parameters:
jobId- client-visible id (same string returned fromdispatch(java.util.Map<java.lang.String, java.lang.Object>))jobInput- TS-shapedIJobProcessorInputanaloguedispatchChannel- distinguishes graph-operation vs graph-action jobs for tracker payloads
-
buildGraphJobProcessorInput
protected Map<String,Object> buildGraphJobProcessorInput(Map<String, Object> data, Map<String, Object> schedule, String jobTag, long startAt) TSIJobProcessorInputfields used by graph dispatch. -
beginTransaction
-
commitTransaction
-
rollbackTransaction
-
executeTransaction
public <T> T executeTransaction(Function<Map<String, Object>, T> callback, Map<String, Object> options) TSgraph.executeTransaction(cb, txnOptions)analogue — executes withinGraphTransactionManagerbegin/commit rollback semantics for the resolved connection adapter. -
supportsFeature
-
supportsFeature
-
processGraphOperationJob
Worker-side entry point forgraph_operationjobs claimed off the Redisson queue. Mirrors theGRAPH_OPERATIONbranch of TSprocessor.service.ts#processJob. -
processGraphActionJob
Worker-side entry point forgraph_actionjobs claimed off the Redisson queue. Mirrors theGRAPH_ACTIONbranch of TSprocessor.service.ts#processJob. -
processProcessorJob
protected Map<String,Object> processProcessorJob(GraphService.ScheduledGraphDispatchChannel channel, Map<String, Object> data) Internal worker entry used byprocessGraphOperationJob(java.util.Map<java.lang.String, java.lang.Object>)/processGraphActionJob(java.util.Map<java.lang.String, java.lang.Object>). Thedatapayload uses the same fields produced bybuildGraphProcessorQueueInput(java.lang.String, java.util.Map<java.lang.String, java.lang.Object>, app.ductape.sdk.graph.GraphService.ScheduledGraphDispatchChannel)(TSprocessor.service.tsGRAPH_* branches):product,env,graph, plus eitheroperation(graph-operation jobs) orevent(graph-action jobs).
-