2 * ============LICENSE_START==========================================
4 * ===================================================================
5 * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
6 * Copyright © 2017-2018 Amdocs
7 * ===================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END============================================
21 package org.onap.aai.champcore;
23 import java.util.List;
25 import java.util.Optional;
26 import java.util.stream.Stream;
28 import org.onap.aai.champcore.exceptions.ChampIndexNotExistsException;
29 import org.onap.aai.champcore.exceptions.ChampMarshallingException;
30 import org.onap.aai.champcore.exceptions.ChampObjectNotExistsException;
31 import org.onap.aai.champcore.exceptions.ChampRelationshipNotExistsException;
32 import org.onap.aai.champcore.exceptions.ChampSchemaViolationException;
33 import org.onap.aai.champcore.exceptions.ChampTransactionException;
34 import org.onap.aai.champcore.exceptions.ChampUnmarshallingException;
35 import org.onap.aai.champcore.model.ChampObject;
36 import org.onap.aai.champcore.model.ChampObjectConstraint;
37 import org.onap.aai.champcore.model.ChampObjectIndex;
38 import org.onap.aai.champcore.model.ChampPartition;
39 import org.onap.aai.champcore.model.ChampRelationship;
40 import org.onap.aai.champcore.model.ChampRelationshipConstraint;
41 import org.onap.aai.champcore.model.ChampRelationshipIndex;
42 import org.onap.aai.champcore.model.ChampSchema;
44 public interface ChampGraph {
47 * Opens a transaction within the graph data store.
49 * @return - A transaction object.
51 public ChampTransaction openTransaction();
54 * Attempts to commit the supplied open transaction.
56 * @param transaction - The transaction to be committed.
58 * @throws ChampTransactionException - If an attempt to commit or rollback the transaction failed.
60 public void commitTransaction(ChampTransaction transaction) throws ChampTransactionException;
63 * Attempts to roll back the supplied open transaction.
65 * @param transaction - The transaction to be committed.
67 * @throws ChampTransactionException - If an attempt to commit or rollback the transaction failed.
69 public void rollbackTransaction(ChampTransaction transaction) throws ChampTransactionException;
72 * Create/Update an object.
74 * If the ChampObject key is present, an update will be attempted,
75 * otherwise a create will be attempted. Each implementation has different guarantees on
76 * validation - see the specific implementation for more details on this.
78 * @param object - The ChampObject that you wish to store in the graph
80 * @return The ChampObject as it was stored
82 * @throws ChampMarshallingException If the {@code object} is not able to be marshalled into the backend representation
83 * @throws ChampSchemaViolationException If the {@code object} violates the constraints specifed by {@link ChampGraph#retrieveSchema}
84 * @throws ChampObjectNotExistsException If {@link org.onap.aai.champcore.model.ChampObject#getKey}.isPresent() but the object cannot be found in the graph
85 * @throws ChampTransactionException If an attempt to commit or rollback the transaction failed.
87 public ChampObject storeObject(ChampObject object) throws ChampMarshallingException, ChampSchemaViolationException, ChampObjectNotExistsException, ChampTransactionException;
90 * Create/Update an object.
92 * If the ChampObject key is present, an update will be attempted,
93 * otherwise a create will be attempted. Each implementation has different guarantees on
94 * validation - see the specific implementation for more details on this.
96 * If a transaction context is not provided, then a transaction will be automatically
97 * created and committed for this operation only, otherwise, the supplied transaction
98 * will be used and it will be up to the caller to commit the transaction at its
101 * @param object - The ChampObject that you wish to store in the graph
102 * @param transaction - Optional transaction context to perform the operation in.
104 * @return The ChampObject as it was stored
106 * @throws ChampMarshallingException If the {@code object} is not able to be marshalled into the backend representation
107 * @throws ChampSchemaViolationException If the {@code object} violates the constraints specifed by {@link ChampGraph#retrieveSchema}
108 * @throws ChampObjectNotExistsException If {@link org.onap.aai.champcore.model.ChampObject#getKey}.isPresent() but the object cannot be found in the graph
109 * @throws ChampTransactionException If an attempt to commit or rollback the transaction failed.
111 public ChampObject storeObject(ChampObject object, Optional<ChampTransaction> transaction) throws ChampMarshallingException, ChampSchemaViolationException, ChampObjectNotExistsException, ChampTransactionException;
114 * Replace an object. ChampObject key is mandatory
116 * Each implementation has different guarantees on validation - see the specific implementation
117 * for more details on this.
119 * @param object - The ChampObject that you wish to replace in the graph
121 * @return The ChampObject as it was stored
123 * @throws ChampMarshallingException If the {@code object} is not able to be marshalled into the backend representation
124 * @throws ChampSchemaViolationException If the {@code object} violates the constraints specifed by {@link ChampGraph#retrieveSchema}
125 * @throws ChampObjectNotExistsException If {@link org.onap.aai.champcore.model.ChampObject#getKey} is not present or object not found in the graph
126 * @throws ChampTransactionException If an attempt to commit or rollback the transaction failed.
128 public ChampObject replaceObject(ChampObject object) throws ChampMarshallingException, ChampSchemaViolationException, ChampObjectNotExistsException, ChampTransactionException;
131 * Replace an object. ChampObject key is mandatory
133 * Each implementation has different guarantees on validation - see the specific implementation
134 * for more details on this.
136 * If a transaction context is not provided, then a transaction will be automatically
137 * created and committed for this operation only, otherwise, the supplied transaction
138 * will be used and it will be up to the caller to commit the transaction at its
141 * @param object - The ChampObject that you wish to replace in the graph
142 * @param transaction - Optional transaction context to perform the operation in.
144 * @return The ChampObject as it was stored
146 * @throws ChampMarshallingException If the {@code object} is not able to be marshalled into the backend representation
147 * @throws ChampSchemaViolationException If the {@code object} violates the constraints specifed by {@link ChampGraph#retrieveSchema}
148 * @throws ChampObjectNotExistsException If {@link org.onap.aai.champcore.model.ChampObject#getKey} is not present or object not found in the graph
149 * @throws ChampTransactionException If an attempt to commit or rollback the transaction failed.
151 public ChampObject replaceObject(ChampObject object, Optional<ChampTransaction> transaction) throws ChampMarshallingException, ChampSchemaViolationException, ChampObjectNotExistsException, ChampTransactionException;
154 * Retrieve an object by its key.
156 * @param key - The key of the ChampObject in the graph {@link org.onap.aai.champcore.model.ChampObject#getKey()}
158 * @return The {@link org.onap.aai.champcore.model.ChampObject} if it was present, otherwise {@link Optional#empty()}
160 * @throws ChampUnmarshallingException If the object was found, but could not be unmarshalled
161 * @throws ChampTransactionException If an attempt to commit or rollback the transaction failed.
163 public Optional<ChampObject> retrieveObject(Object key) throws ChampUnmarshallingException, ChampTransactionException;
167 * Retrieve an object by its key.
169 * If a transaction context is not provided, then a transaction will be automatically
170 * created and committed for this operation only, otherwise, the supplied transaction
171 * will be used and it will be up to the caller to commit the transaction at its
174 * @param key - The key of the ChampObject in the graph {@link org.onap.aai.champcore.model.ChampObject#getKey()}
175 * @param transaction - Optional transaction context to perform the operation in.
177 * @return The {@link org.onap.aai.champcore.model.ChampObject} if it was present, otherwise {@link Optional#empty()}
179 * @throws ChampUnmarshallingException If the object was found, but could not be unmarshalled
180 * @throws ChampTransactionException If an attempt to commit or rollback the transaction failed.
182 public Optional<ChampObject> retrieveObject(Object key, Optional<ChampTransaction> transaction) throws ChampUnmarshallingException, ChampTransactionException;
185 * Delete an object by its key.
187 * @param key - The key of the ChampObject in the graph {@link ChampObject#getKey}
189 * @throws ChampObjectNotExistsException If the object did not exist in the graph
190 * @throws ChampTransactionException If an attempt to commit or rollback the transaction failed.
192 public void deleteObject(Object key) throws ChampObjectNotExistsException, ChampTransactionException;
195 * Delete an object by its key.
197 * If a transaction context is not provided, then a transaction will be automatically
198 * created and committed for this operation only, otherwise, the supplied transaction
199 * will be used and it will be up to the caller to commit the transaction at its
202 * @param key - The key of the ChampObject in the graph {@link ChampObject#getKey}
203 * @param transaction - Optional transaction context to perform the operation in.
205 * @throws ChampObjectNotExistsException If the object did not exist in the graph
206 * @throws ChampTransactionException If an attempt to commit or rollback the transaction failed.
208 public void deleteObject(Object key, Optional<ChampTransaction> transaction) throws ChampObjectNotExistsException, ChampTransactionException;
211 * Retrieve all the objects whose properties match the given {@code queryParams}
213 * @param queryParams - The key/value pairs which are found in {@link ChampObject#getProperties}
215 * @return - A {@link Stream} where each {@link ChampObject#getProperties} contains the {@code queryParams}
217 * @throws ChampTransactionException If an attempt to commit or rollback the transaction failed.
219 public Stream<ChampObject> queryObjects(Map<String, Object> queryParams) throws ChampTransactionException;
223 * Retrieve all the objects whose properties match the given {@code queryParams}
225 * If a transaction context is not provided, then a transaction will be automatically
226 * created and committed for this operation only, otherwise, the supplied transaction
227 * will be used and it will be up to the caller to commit the transaction at its
230 * @param queryParams - The key/value pairs which are found in {@link ChampObject#getProperties}
231 * @param transaction - Optional transaction context to perform the operation in.
233 * @return - A {@link Stream} where each {@link ChampObject#getProperties} contains the {@code queryParams}
235 * @throws ChampTransactionException If an attempt to commit or rollback the transaction failed.
237 public Stream<ChampObject> queryObjects(Map<String, Object> queryParams, Optional<ChampTransaction> transaction) throws ChampTransactionException;
240 * Create/Update a relationship.
242 * If the ChampRelationship key is present, an update will be attempted,
243 * otherwise a create will be attempted. Each implementation has different guarantees on
244 * validation - see the specific implementation for more details on this.
246 * @param relationship - The ChampRelationship that you wish to store in the graph
248 * @return The ChampRelationship as it was stored
250 * @throws ChampMarshallingException If the {@code relationship} is not able to be marshalled into the backend representation
251 * @throws ChampSchemaViolationException If the {@code relationship} violates the constraints specifed by {@link ChampGraph#retrieveSchema}
252 * @throws ChampObjectNotExistsException If either the source or target object referenced by this relationship does not exist in the graph
253 * @throws ChampRelationshipNotExistsException If {@link org.onap.aai.champcore.model.ChampRelationship#getKey}.isPresent() but the object cannot be found in the graph
254 * @throws ChampUnmarshallingException If the edge which was created could not be unmarshalled into a ChampRelationship
255 * @throws ChampTransactionException If an attempt to commit or rollback the transaction failed.
257 public ChampRelationship storeRelationship(ChampRelationship relationship) throws ChampMarshallingException, ChampObjectNotExistsException, ChampSchemaViolationException, ChampRelationshipNotExistsException, ChampUnmarshallingException, ChampTransactionException;
261 * Create/Update a relationship.
263 * If the ChampRelationship key is present, an update will be attempted,
264 * otherwise a create will be attempted. Each implementation has different guarantees on
265 * validation - see the specific implementation for more details on this.
267 * If a transaction context is not provided, then a transaction will be automatically
268 * created and committed for this operation only, otherwise, the supplied transaction
269 * will be used and it will be up to the caller to commit the transaction at its
272 * @param relationship - The ChampRelationship that you wish to store in the graph
273 * @param transaction - Optional transaction context to perform the operation in.
275 * @return The ChampRelationship as it was stored
277 * @throws ChampMarshallingException If the {@code relationship} is not able to be marshalled into the backend representation
278 * @throws ChampSchemaViolationException If the {@code relationship} violates the constraints specifed by {@link ChampGraph#retrieveSchema}
279 * @throws ChampObjectNotExistsException If either the source or target object referenced by this relationship does not exist in the graph
280 * @throws ChampRelationshipNotExistsException If {@link org.onap.aai.champcore.model.ChampRelationship#getKey}.isPresent() but the object cannot be found in the graph
281 * @throws ChampUnmarshallingException If the edge which was created could not be unmarshalled into a ChampRelationship
282 * @throws ChampTransactionException If an attempt to commit or rollback the transaction failed.
284 public ChampRelationship storeRelationship(ChampRelationship relationship, Optional<ChampTransaction> transaction) throws ChampMarshallingException, ChampObjectNotExistsException, ChampSchemaViolationException, ChampRelationshipNotExistsException, ChampUnmarshallingException, ChampTransactionException;
287 * Replace a relationship.
289 * ChampRelationship key is mandatory. The main purpose of this method is to replace the
290 * entire properties of an existing relationship. Source/Target can't be updated with this method.
292 * Each implementation has different guarantees on validation - see the specific implementation
293 * for more details on this.
295 * @param relationship - The ChampRelationship that you wish to replace in the graph
297 * @return The ChampRelationship as it was stored
299 * @throws ChampMarshallingException If the {@code relationship} is not able to be marshalled into the backend representation
300 * @throws ChampSchemaViolationException If the {@code relationship} violates the constraints specifed by {@link ChampGraph#retrieveSchema}
301 * @throws ChampRelationshipNotExistsException If {@link org.onap.aai.champcore.model.ChampRelationship#getKey} is not present or object not found in the graph
302 * @throws ChampUnmarshallingException If the edge which was created could not be unmarshalled into a ChampRelationship
303 * @throws ChampTransactionException If an attempt to commit or rollback the transaction failed.
305 public ChampRelationship replaceRelationship(ChampRelationship relationship) throws ChampMarshallingException, ChampSchemaViolationException, ChampRelationshipNotExistsException, ChampUnmarshallingException, ChampTransactionException;
308 * Replace a relationship.
310 * ChampRelationship key is mandatory. The main purpose of this method is to replace the
311 * entire properties of an existing relationship. Source/Target can't be updated with this method.
313 * Each implementation has different guarantees on validation - see the specific implementation
314 * for more details on this.
316 * If a transaction context is not provided, then a transaction will be automatically
317 * created and committed for this operation only, otherwise, the supplied transaction
318 * will be used and it will be up to the caller to commit the transaction at its
321 * @param relationship - The ChampRelationship that you wish to replace in the graph
322 * @param transaction - Optional transaction context to perform the operation in.
324 * @return The ChampRelationship as it was stored
326 * @throws ChampMarshallingException If the {@code relationship} is not able to be marshalled into the backend representation
327 * @throws ChampSchemaViolationException If the {@code relationship} violates the constraints specifed by {@link ChampGraph#retrieveSchema}
328 * @throws ChampRelationshipNotExistsException If {@link org.onap.aai.champcore.model.ChampRelationship#getKey} is not present or object not found in the graph
329 * @throws ChampUnmarshallingException If the edge which was created could not be unmarshalled into a ChampRelationship
330 * @throws ChampTransactionException If an attempt to commit or rollback the transaction failed.
332 public ChampRelationship replaceRelationship(ChampRelationship relationship, Optional<ChampTransaction> transaction) throws ChampMarshallingException, ChampSchemaViolationException, ChampRelationshipNotExistsException, ChampUnmarshallingException, ChampTransactionException;
335 * Retrieve a relationship by its key.
337 * @param key - The key of the ChampRelationship in the graph
338 * {@link org.onap.aai.champcore.model.ChampRelationship#getKey()}
340 * @return The {@link org.onap.aai.champcore.model.ChampRelationship} if it was present, otherwise {@link Optional#empty()}
342 * @throws ChampUnmarshallingException If the relationship was found, but could not be unmarshalled
343 * @throws ChampTransactionException If an attempt to commit or rollback the transaction failed.
345 public Optional<ChampRelationship> retrieveRelationship(Object key) throws ChampUnmarshallingException, ChampTransactionException;
349 * Retrieve a relationship by its key.
351 * If a transaction context is not provided, then a transaction will be automatically
352 * created and committed for this operation only, otherwise, the supplied transaction
353 * will be used and it will be up to the caller to commit the transaction at its
356 * @param key - The key of the ChampRelationship in the graph
357 * {@link org.onap.aai.champcore.model.ChampRelationship#getKey()}
358 * @param transaction - Optional transaction context to perform the operation in.
360 * @return The {@link org.onap.aai.champcore.model.ChampRelationship} if it was present, otherwise {@link Optional#empty()}
362 * @throws ChampUnmarshallingException If the relationship was found, but could not be unmarshalled
363 * @throws ChampTransactionException If an attempt to commit or rollback the transaction failed.
365 public Optional<ChampRelationship> retrieveRelationship(Object key, Optional<ChampTransaction> transaction) throws ChampUnmarshallingException, ChampTransactionException;
368 * Delete a relationship by its key.
370 * @param relationship - The ChampRelationship in the graph ({@link ChampRelationship#getKey must be present})
372 * @throws ChampRelationshipNotExistsException If the object did not exist in the graph
373 * @throws ChampTransactionException If an attempt to commit or rollback the transaction failed.
375 public void deleteRelationship(ChampRelationship relationship) throws ChampRelationshipNotExistsException, ChampTransactionException;
378 * Delete a relationship by its key.
380 * If a transaction context is not provided, then a transaction will be automatically
381 * created and committed for this operation only, otherwise, the supplied transaction
382 * will be used and it will be up to the caller to commit the transaction at its
385 * @param relationship - The ChampRelationship in the graph ({@link ChampRelationship#getKey must be present})
386 * @param transaction - Optional transaction context to perform the operation in.
388 * @throws ChampRelationshipNotExistsException If the object did not exist in the graph
389 * @throws ChampTransactionException If an attempt to commit or rollback the transaction failed.
391 public void deleteRelationship(ChampRelationship relationship, Optional<ChampTransaction> transaction) throws ChampRelationshipNotExistsException, ChampTransactionException;
394 * Retrieve the relationships which are incident to the {@code object}
396 * @param object - The object you wish to find incident relationships for
398 * @return A {@link Stream} where each {@link ChampRelationship} has this {@code object} as either a source or target object
400 * @throws ChampUnmarshallingException If any of the ChampRelationship objects could not be unmarshalled
401 * @throws ChampObjectNotExistsException If the {@code object} does not exist in this graph
402 * @throws ChampTransactionException If an attempt to commit or rollback the transaction failed.
404 public Stream<ChampRelationship> retrieveRelationships(ChampObject object) throws ChampUnmarshallingException, ChampObjectNotExistsException, ChampTransactionException;
408 * Retrieve the relationships which are incident to the {@code object}
410 * If a transaction context is not provided, then a transaction will be automatically
411 * created and committed for this operation only, otherwise, the supplied transaction
412 * will be used and it will be up to the caller to commit the transaction at its
415 * @param object - The object you wish to find incident relationships for
416 * @param transaction - Optional transaction context to perform the operation in.
418 * @return A {@link Stream} where each {@link ChampRelationship} has this {@code object} as either a source or target object
420 * @throws ChampUnmarshallingException If any of the ChampRelationship objects could not be unmarshalled
421 * @throws ChampObjectNotExistsException If the {@code object} does not exist in this graph
422 * @throws ChampTransactionException If an attempt to commit or rollback the transaction failed.
424 public Stream<ChampRelationship> retrieveRelationships(ChampObject object, Optional<ChampTransaction> transaction) throws ChampUnmarshallingException, ChampObjectNotExistsException, ChampTransactionException;
427 * Retrieve the relationships whose properties match the given {@code queryParams}
429 * @param queryParams - The key/value pairs to search for in the {@link ChampRelationship#getProperties}
431 * @return A {@link Stream} where each {@link ChampRelationship#getProperties} contains the {@code queryParams}
433 * @throws ChampTransactionException If an attempt to commit or rollback the transaction failed.
435 public Stream<ChampRelationship> queryRelationships(Map<String, Object> queryParams) throws ChampTransactionException;
438 * Retrieve the relationships whose properties match the given {@code queryParams}
440 * If a transaction context is not provided, then a transaction will be automatically
441 * created and committed for this operation only, otherwise, the supplied transaction
442 * will be used and it will be up to the caller to commit the transaction at its
445 * @param queryParams - The key/value pairs to search for in the {@link ChampRelationship#getProperties}
446 * @param transaction - Optional transaction context to perform the operation in.
448 * @return A {@link Stream} where each {@link ChampRelationship#getProperties} contains the {@code queryParams}
450 * @throws ChampTransactionException If an attempt to commit or rollback the transaction failed.
452 public Stream<ChampRelationship> queryRelationships(Map<String, Object> queryParams, Optional<ChampTransaction> transaction) throws ChampTransactionException;
455 * Create/Update a {@link ChampPartition}. If any of the ChampObjects or ChampRelationships
456 * present in this ChampPartition already exist, an update will be attempted, otherwise a create
459 * Each implementation has different guarantees on validation -
460 * see the specific implementation details for more information on this.
462 * @param partition - The ChampPartition you wish to store in this graph
464 * @throws ChampMarshallingException If any of the objects or relationships contained in this
465 * partition could not be marshalled into its backed representation
466 * @throws ChampObjectNotExistsException If any of the objects being updated do not exist, or if a relationship
467 * contain objects which do not exist in the graph.
468 * @throws ChampSchemaViolationException If any of the objects or relationships violate the schema provided by {@link retrieveSchema}
469 * @throws ChampRelationshipNotExistsException If any of the relationships which are being updated do not exist
470 * @throws ChampTransactionException If an attempt to commit or rollback the transaction failed.
472 * @return The ChampPartition as is was stored in the graph (contains keys for each newly created object)
474 public ChampPartition storePartition(ChampPartition partition) throws ChampMarshallingException, ChampObjectNotExistsException, ChampSchemaViolationException, ChampRelationshipNotExistsException, ChampTransactionException;
477 * Create/Update a {@link ChampPartition}. If any of the ChampObjects or ChampRelationships
478 * present in this ChampPartition already exist, an update will be attempted, otherwise a create
481 * Each implementation has different guarantees on validation -
482 * see the specific implementation details for more information on this.
484 * If a transaction context is not provided, then a transaction will be automatically
485 * created and committed for this operation only, otherwise, the supplied transaction
486 * will be used and it will be up to the caller to commit the transaction at its
489 * @param partition - The ChampPartition you wish to store in this graph
490 * @param transaction - Optional transaction context to perform the operation in.
492 * @throws ChampMarshallingException If any of the objects or relationships contained in this
493 * partition could not be marshalled into its backed representation
494 * @throws ChampObjectNotExistsException If any of the objects being updated do not exist, or if a relationship
495 * contain objects which do not exist in the graph.
496 * @throws ChampSchemaViolationException If any of the objects or relationships violate the schema provided by {@link retrieveSchema}
497 * @throws ChampRelationshipNotExistsException If any of the relationships which are being updated do not exist
498 * @throws ChampTransactionException If an attempt to commit or rollback the transaction failed.
500 * @return The ChampPartition as is was stored in the graph (contains keys for each newly created object)
502 public ChampPartition storePartition(ChampPartition partition, Optional<ChampTransaction> transaction) throws ChampMarshallingException, ChampObjectNotExistsException, ChampSchemaViolationException, ChampRelationshipNotExistsException, ChampTransactionException;
505 * Delete the {@code partition} from the graph.
507 * @param partition - The partition to delete from the graph
509 * @throws ChampTransactionException If an attempt to commit or rollback the transaction failed.
511 public void deletePartition(ChampPartition partition) throws ChampTransactionException;
514 * Delete the {@code partition} from the graph.
516 * If a transaction context is not provided, then a transaction will be automatically
517 * created and committed for this operation only, otherwise, the supplied transaction
518 * will be used and it will be up to the caller to commit the transaction at its
521 * @param partition - The partition to delete from the graph
522 * @param transaction - Optional transaction context to perform the operation in.
524 * @throws ChampTransactionException If an attempt to commit or rollback the transaction failed.
526 public void deletePartition(ChampPartition partition, Optional<ChampTransaction> transaction) throws ChampTransactionException;
529 * Create/Update an object index on the graph
530 * @param index - The index to create on this {@code graph}
532 public void storeObjectIndex(ChampObjectIndex index);
535 * Retrieve an object index on the graph by its {@code indexName}
536 * @param indexName The name of the index to retrieve from the graph
537 * @return The {@link ChampObjectIndex} which matches the given @{code indexName} in the graph
539 public Optional<ChampObjectIndex> retrieveObjectIndex(String indexName);
542 * Retrieve the object indices on the graph
543 * @return A {@link Stream} where each {@link ChampObjectIndex} exists in the graph
545 public Stream<ChampObjectIndex> retrieveObjectIndices();
548 * Delete the object index on the graph by its {@code indexName}
549 * @param indexName The name of the index to delete from the graph
550 * @throws ChampIndexNotExistsException If an index does not exist with the given {@code indexName} in the graph
552 public void deleteObjectIndex(String indexName) throws ChampIndexNotExistsException;
555 * Create/Update a relationship index on the graph
556 * @param index The relationship index to create on the graph
558 public void storeRelationshipIndex(ChampRelationshipIndex index);
561 * Retrieve a relationship index from the graph
562 * @param indexName The name of the relationship index to retrieve from the graph
563 * @return The {@link ChampRelationshipIndex} which matches the given {@code indexName} in the graph
564 * or {@link Optional#empty} if no such relationship index exists
566 public Optional<ChampRelationshipIndex> retrieveRelationshipIndex(String indexName);
569 * Retrieve the relationship indices from the graph
570 * @return A {@link Stream} where each {@link ChampRelationshipIndex} exists in the graph
572 public Stream<ChampRelationshipIndex> retrieveRelationshipIndices();
575 * Delete a relationship index from the graph
576 * @param indexName THe name of the index to delete from the graph
577 * @throws ChampIndexNotExistsException If an index does not exist with the give {@code indexName} in the graph
579 public void deleteRelationshipIndex(String indexName) throws ChampIndexNotExistsException;
582 * Create/Update the schema for a graph
583 * @param schema The {@link ChampSchema} to create or update on the graph
584 * @throws ChampSchemaViolationException If this schema update would violate the current schema
586 public void storeSchema(ChampSchema schema) throws ChampSchemaViolationException;
589 * Retrieve the schema for a graph
590 * @return The {@link ChampSchema} for the graph
592 public ChampSchema retrieveSchema();
595 * Create/Update an object constraint on a schema
596 * @param objectConstraint The object constraint you wish to create/update for the graph
597 * @throws ChampSchemaViolationException If this schema update would violate the current schema
599 public void updateSchema(ChampObjectConstraint objectConstraint) throws ChampSchemaViolationException;
602 * Create/Update a relationship constraint on a schema
603 * @param schema The relationship constraint you wish to create/update for the graph
604 * @throws ChampSchemaViolationException If this schema update would violate the current schema
606 public void updateSchema(ChampRelationshipConstraint schema) throws ChampSchemaViolationException;
609 * Delete the schema for a graph
611 public void deleteSchema();
614 * Shutdown the ChampAPI. It is up to the caller to synchronize access to the ChampAPI
615 * so that shutting it down does not interfere with concurrent operations.
617 public void shutdown();
620 * Used to determine what the outcome of certain ChampGraph operations will be. For example,
621 * if this graph is not capable of deleting object indices, you can expect those calls to fail.
622 * @see ChampCapabilities
623 * @return What this graph is capable of performing
625 public ChampCapabilities capabilities();