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.

Introduced properties

fun body: nullable Serializable

neo4j :: NeoJob :: body

Body to send with the job service request
protected fun body=(body: nullable Serializable)

neo4j :: NeoJob :: body=

Body to send with the job service request
init defaultinit(id: Int, entity: NeoEntity)

neo4j :: NeoJob :: defaultinit

fun entity: NeoEntity

neo4j :: NeoJob :: entity

Entity targeted by the job
protected fun entity=(entity: NeoEntity)

neo4j :: NeoJob :: entity=

Entity targeted by the job
fun id: Int

neo4j :: NeoJob :: id

The job uniq id
protected fun id=(id: Int)

neo4j :: NeoJob :: id=

The job uniq id
fun method: String

neo4j :: NeoJob :: method

Job HTTP method: GET, POST, PUT, DELETE...
protected fun method=(method: String)

neo4j :: NeoJob :: method=

Job HTTP method: GET, POST, PUT, DELETE...
fun to: String

neo4j :: NeoJob :: to

Job service target: /node, /labels etc...
protected fun to=(to: String)

neo4j :: NeoJob :: to=

Job service target: /node, /labels etc...
fun to_rest: JsonObject

neo4j :: NeoJob :: to_rest

JSON formated job

Redefined properties

redef type SELF: NeoJob

neo4j $ NeoJob :: SELF

Type of this instance, automatically specialized in every class

All properties

fun !=(other: nullable Object): Bool

core :: Object :: !=

Have self and other different values?
fun ==(other: nullable Object): Bool

core :: Object :: ==

Have self and other the same value?
type CLASS: Class[SELF]

core :: Object :: CLASS

The type of the class of self.
type SELF: Object

core :: Object :: SELF

Type of this instance, automatically specialized in every class
fun body: nullable Serializable

neo4j :: NeoJob :: body

Body to send with the job service request
protected fun body=(body: nullable Serializable)

neo4j :: NeoJob :: body=

Body to send with the job service request
protected fun class_factory(name: String): CLASS

core :: Object :: class_factory

Implementation used by get_class to create the specific class.
fun class_name: String

core :: Object :: class_name

The class name of the object.
init defaultinit(id: Int, entity: NeoEntity)

neo4j :: NeoJob :: defaultinit

fun entity: NeoEntity

neo4j :: NeoJob :: entity

Entity targeted by the job
protected fun entity=(entity: NeoEntity)

neo4j :: NeoJob :: entity=

Entity targeted by the job
fun get_class: CLASS

core :: Object :: get_class

The meta-object representing the dynamic type of self.
fun hash: Int

core :: Object :: hash

The hash code of the object.
fun id: Int

neo4j :: NeoJob :: id

The job uniq id
protected fun id=(id: Int)

neo4j :: NeoJob :: id=

The job uniq id
init init

core :: Object :: init

fun inspect: String

core :: Object :: inspect

Developer readable representation of self.
protected fun inspect_head: String

core :: Object :: inspect_head

Return "CLASSNAME:#OBJECTID".
intern fun is_same_instance(other: nullable Object): Bool

core :: Object :: is_same_instance

Return true if self and other are the same instance (i.e. same identity).
fun is_same_serialized(other: nullable Object): Bool

core :: Object :: is_same_serialized

Is self the same as other in a serialization context?
intern fun is_same_type(other: Object): Bool

core :: Object :: is_same_type

Return true if self and other have the same dynamic type.
fun method: String

neo4j :: NeoJob :: method

Job HTTP method: GET, POST, PUT, DELETE...
protected fun method=(method: String)

neo4j :: NeoJob :: method=

Job HTTP method: GET, POST, PUT, DELETE...
intern fun object_id: Int

core :: Object :: object_id

An internal hash code for the object based on its identity.
fun output

core :: Object :: output

Display self on stdout (debug only).
intern fun output_class_name

core :: Object :: output_class_name

Display class name on stdout (debug only).
fun serialization_hash: Int

core :: Object :: serialization_hash

Hash value use for serialization
intern fun sys: Sys

core :: Object :: sys

Return the global sys object, the only instance of the Sys class.
fun to: String

neo4j :: NeoJob :: to

Job service target: /node, /labels etc...
protected fun to=(to: String)

neo4j :: NeoJob :: to=

Job service target: /node, /labels etc...
abstract fun to_jvalue(env: JniEnv): JValue

core :: Object :: to_jvalue

fun to_rest: JsonObject

neo4j :: NeoJob :: to_rest

JSON formated job
fun to_s: String

core :: Object :: to_s

User readable representation of self.
package_diagram neo4j::NeoJob NeoJob core::Object Object neo4j::NeoJob->core::Object

Parents

interface Object

core :: Object

The root of the class hierarchy.

Class definitions

neo4j $ NeoJob
# 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