new GraphDef(baseTag [, operation])
Creates an instance of GraphDef
.
Parameters:
Name | Type | Argument | Default | Description |
---|---|---|---|---|
baseTag |
olympe.dc.InstanceTag | The base tag for the graph. |
||
operation |
olympe.dc.GraphDefOperation |
<optional> |
olympe.dc.GraphDefOperation.SUBSCRIBE | The graphdef operation |
Members
-
<non-null> followRules :olympe.dc.FollowRules
-
Type:
- olympe.dc.FollowRules
Methods
-
<static> deleteInstance(instance [, callback])
-
Sends a 'delete' graph request to delete the specified instance from the data-cloud.
Parameters:
Name Type Argument Description instance
olympe.dc.InstanceTag The instance to delete.
callback
olympe.dc.Manager.TransactionCallback <optional>
The function that will be provided with the result.
-
<static> deleteInstances(instances [, callback])
-
Sends a 'delete' graph request to delete the specified list of instances from the data-cloud.
Parameters:
Name Type Argument Description instances
Array.<olympe.dc.InstanceTag> The instances to delete.
callback
olympe.dc.Manager.TransactionCallback <optional>
The function to pass the result.
-
<static> fromJSON(json)
-
Deserializes a
GraphDef
from a JSON object or string.Parameters:
Name Type Description json
string | Object Returns:
- Type
- olympe.dc.GraphDef
-
activateFollowRules(rule)
-
Activates the follow rules option for the current GraphDef node.
Parameters:
Name Type Description rule
olympe.dc.FollowRules The 'follow' rule to activate.
Returns:
This
GraphDef
.- Type
- olympe.dc.GraphDef
-
add(relation [, recursive] [, apply])
-
Adds a relation to the
GraphDef
at the same node.Parameters:
Name Type Argument Default Description relation
olympe.dc.registry.Relation The relation.
recursive
boolean <optional>
false true
when we want to recurse on this relationapply
boolean <optional>
true true
to apply the operation.Returns:
This
GraphDef
.- Type
- olympe.dc.GraphDef
-
addSkipCoveragePredicate(predicate)
-
Adds a predicate function to skip the check of coverage of specific relations. Works only for implicit graphdefs.
Parameters:
Name Type Description predicate
olympe.dc.GraphDef.SkipCoveragePredicate Returns:
This
GraphDef
.- Type
- olympe.dc.GraphDef
-
back( [times])
-
Moves back up one or more hops in the graph.
Parameters:
Name Type Argument Default Description times
number <optional>
1 Number of hops.
Returns:
This
GraphDef
.- Type
- olympe.dc.GraphDef
-
backToRoot()
-
Moves back to the top of the graph.
Returns:
This
GraphDef
.- Type
- olympe.dc.GraphDef
-
buildQuery( [context])
-
Builds the GraphQuery corresponding to this Graphdef, which will be used to monitor the state of the subscription
Parameters:
Name Type Argument Description context
olympe.df.ExecutionContext <optional>
Returns:
The graph query associated to the current state of this graphdef.
-
execute( [callback])
-
Executes this graphdef request. Effectively passes this graphdef to the query engine for it to subscribe to it or to pull it, depending on the operation. In case of subscription, also schedules unsubscription to it upon detachment of the current context. The optional specified callback will be called with the graphdef query result within the current execution context.
Parameters:
Name Type Argument Description callback
olympe.dc.query.GraphQuery.GraphResultHandler <optional>
The callback function.
-
follow(relation [, recursive])
-
Extends the graph by specifying a relation to follow.
Parameters:
Name Type Argument Default Description relation
olympe.dc.registry.Relation The relation.
recursive
boolean <optional>
false true
when we want to recurse on this relationReturns:
This
GraphDef
.- Type
- olympe.dc.GraphDef
-
getBlocks()
-
Return an iterable object of all the blocks of this graphdef
Throw an error if the graphdef is in fact an implicit one.
Returns:
- Type
- Iterable.<!olympe.dc.query.GraphQueryBlock>
-
getCreationReason()
-
Returns the reason of this graphdef creation, if one has been set.
Returns:
- Type
- string
-
getFollowRules()
-
Return the follow rules activated for this graphdef. The follow rule 'olympe.dc.FollowRules.NONE' indicates an explicit graphdef
Returns:
- Type
- olympe.dc.FollowRules
-
getId()
-
Generate and return the id of a graphdef based on its content.
Returns:
The graphdef id.
- Type
- string
-
getOperation()
-
Gets the operation (SUBSCRIBE, PULL, QUERY) associated with this
GraphDef
.Returns:
The operation.
-
getRootTag()
-
Return the tag of the root instance of this graphdef
Returns:
- Type
- string
-
getSkipCoveragePredicates()
-
Returns the list of skip predicates.
Returns:
- Type
- Array.<!olympe.dc.GraphDef.SkipCoveragePredicate>
-
isImplicit()
-
Return true if current graphdef is implicit
Returns:
- Type
- boolean
-
setCreationReason(reason)
-
Set the reason of this graphdef creation. This is used for debug purposes.
Parameters:
Name Type Description reason
string Returns:
This
GraphDef
.- Type
- olympe.dc.GraphDef
-
toJSON()
-
Serializes this
GraphDef
into a JSON string.Returns:
- Type
- string
Type Definitions
-
SkipCoveragePredicate(root, relation)
-
Predicate functions used to skip specific verification of coverage.
Parameters:
Name Type Description root
string relation
olympe.dc.query.Relation Returns:
- Type
- boolean