Class EdgeService
java.lang.Object
io.skipcheck.tm1.client.service.dimension.EdgeService
Edges:
/Dimensions('d')/Hierarchies('h')/Edges, the parent-child links of a
hierarchy, each keyed by its parent's and its component's names.
List a hierarchy's edges:
// Every parent-child link of the hierarchy, as "parent > child (weight)"
return tm1.edges()
.list("Region", "Region", ODataQuery.none())
.map(edge -> edge.parentName() + " > " + edge.componentName() + " (" + edge.weight() + ")");
Change an edge's weight:
// Make Cost count negatively in Margin
return tm1.edges().update("Account", "Account", "Margin", "Cost", EdgePatch.builder().weight(-1.0).build());
Move an element to another parent:
// Move North from Total to Total Sales: add the new edge, then delete the old
return tm1.edges()
.create("Region", "Region",
EdgePatch.builder().parentName("Total Sales").componentName("North").weight(1.0).build())
.flatMap(edge -> tm1.edges().delete("Region", "Region", "Total", "North").thenReturn(edge));
-
Constructor Summary
ConstructorsConstructorDescriptionEdgeService(Tm1Session session) A service sending its requests throughsession. -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<Element> GET …/Edges(…)/Component.reactor.core.publisher.Mono<Edge> POST …/Edges: makes an element a child of a consolidation.reactor.core.publisher.Mono<Void> DELETE …/Edges(ParentName='p',ComponentName='c'): takes an element out of a consolidation; the element stays in the hierarchy.reactor.core.publisher.Mono<Edge> GET …/Edges(ParentName='p',ComponentName='c').reactor.core.publisher.Mono<Hierarchy> GET …/Edges(…)/Hierarchy.reactor.core.publisher.Flux<Edge> list(String dimension, String hierarchy, ODataQuery query) GET …/Hierarchies('h')/Edges, streamed.reactor.core.publisher.Mono<Element> GET …/Edges(…)/Parent.reactor.core.publisher.Mono<Void> PATCH …/Edges(ParentName='p',ComponentName='c'): changes the edge's weight.
-
Constructor Details
-
EdgeService
A service sending its requests throughsession.- Parameters:
session- the session
-
-
Method Details
-
list
@Tm1Endpoint("Navigation Hierarchy/Edges") public reactor.core.publisher.Flux<Edge> list(String dimension, String hierarchy, ODataQuery query) GET …/Hierarchies('h')/Edges, streamed.- Parameters:
dimension- the dimension's namehierarchy- the hierarchy's namequery- what to select, expand, filter and order- Returns:
- the hierarchy's edges
-
get
@Tm1Endpoint("Navigation Hierarchy/Edges") public reactor.core.publisher.Mono<Edge> get(String dimension, String hierarchy, String parent, String component, ODataQuery query) GET …/Edges(ParentName='p',ComponentName='c').- Parameters:
dimension- the dimension's namehierarchy- the hierarchy's nameparent- the parent's namecomponent- the component's namequery- what to select and expand- Returns:
- the edge, or a
Tm1NotFoundExceptionif there's none
-
create
@Tm1Endpoint("Navigation Hierarchy/Edges") public reactor.core.publisher.Mono<Edge> create(String dimension, String hierarchy, EdgePatch edge) POST …/Edges: makes an element a child of a consolidation.- Parameters:
dimension- the dimension's namehierarchy- the hierarchy's nameedge- the new edge: parent, component and, optionally, weight- Returns:
- the edge as created
-
update
@Tm1Endpoint("Navigation Hierarchy/Edges") public reactor.core.publisher.Mono<Void> update(String dimension, String hierarchy, String parent, String component, EdgePatch patch) PATCH …/Edges(ParentName='p',ComponentName='c'): changes the edge's weight.- Parameters:
dimension- the dimension's namehierarchy- the hierarchy's nameparent- the parent's namecomponent- the component's namepatch- the changes- Returns:
- completes when the edge is changed
-
delete
@Tm1Endpoint("Navigation Hierarchy/Edges") public reactor.core.publisher.Mono<Void> delete(String dimension, String hierarchy, String parent, String component) DELETE …/Edges(ParentName='p',ComponentName='c'): takes an element out of a consolidation; the element stays in the hierarchy.- Parameters:
dimension- the dimension's namehierarchy- the hierarchy's nameparent- the parent's namecomponent- the component's name- Returns:
- completes when the edge is deleted
-
parent
@Tm1Endpoint("Navigation Edge/Parent") public reactor.core.publisher.Mono<Element> parent(String dimension, String hierarchy, String parent, String component, ODataQuery query) GET …/Edges(…)/Parent.- Parameters:
dimension- the dimension's namehierarchy- the hierarchy's nameparent- the parent's namecomponent- the component's namequery- what to select and expand- Returns:
- the edge's parent
-
component
@Tm1Endpoint("Navigation Edge/Component") public reactor.core.publisher.Mono<Element> component(String dimension, String hierarchy, String parent, String component, ODataQuery query) GET …/Edges(…)/Component.- Parameters:
dimension- the dimension's namehierarchy- the hierarchy's nameparent- the parent's namecomponent- the component's namequery- what to select and expand- Returns:
- the edge's component
-
hierarchy
@Tm1Endpoint("Navigation Edge/Hierarchy") public reactor.core.publisher.Mono<Hierarchy> hierarchy(String dimension, String hierarchy, String parent, String component, ODataQuery query) GET …/Edges(…)/Hierarchy.- Parameters:
dimension- the dimension's namehierarchy- the hierarchy's nameparent- the parent's namecomponent- the component's namequery- what to select and expand- Returns:
- the edge's hierarchy
-