NeoBatch
This is a representation of a neo job in JSON Format
Each job description should contain a to
attribute, with a value relative to the data API root
(so http://neo4j:7474/db/data/node becomes just /node), and a method
attribute containing
HTTP verb to use.
Optionally you may provide a body
attribute, and an id
attribute to help you keep track
of responses, although responses are guaranteed to be returned in the same order the job
descriptions are received.
neo4j :: NeoJob :: defaultinit
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
core :: Object :: defaultinit
neo4j :: NeoJob :: defaultinit
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
core :: Object :: output_class_name
Display class name on stdout (debug only).
# A job that can be executed in a `NeoBatch`
# This is a representation of a neo job in JSON Format
#
# Each job description should contain a `to` attribute, with a value relative to the data API root
# (so http://neo4j:7474/db/data/node becomes just /node), and a `method` attribute containing
# HTTP verb to use.
#
# Optionally you may provide a `body` attribute, and an `id` attribute to help you keep track
# of responses, although responses are guaranteed to be returned in the same order the job
# descriptions are received.
class NeoJob
# The job uniq `id`
var id: Int
# Entity targeted by the job
var entity: NeoEntity
init(id: Int, entity: NeoEntity) do
self.id = id
self.entity = entity
end
# What kind of action do the job
# used to attach responses to original Neo objets
private var action: nullable Int = null
# Job HTTP method: `GET`, `POST`, `PUT`, `DELETE`...
var method: String
# Job service target: `/node`, `/labels` etc...
var to: String
# Body to send with the job service request
var body: nullable Serializable = null
# JSON formated job
fun to_rest: JsonObject do
var job = new JsonObject
job["id"] = id
job["method"] = method
job["to"] = to
if not body == null then
job["body"] = body
end
return job
end
end
lib/neo4j/neo4j.nit:974,1--1017,3