public interface IdGenerator
If the client needs to control this process, it may implement this interface and install it in the WitsmlServer:
/** * Class for generating IDs for new WITSML objects. */ class MyIdGenerator implements no.petroware.jwitsml.IdGenerator { public String generateId(String witsmlType, String name, WitsmlObject parent, String defaultId) { String id = ...; return id; } } // Register the ID generator witsmlServer.setIdGenerator(new MyIdGenerator());Note that this is optional and that JWitsml by default will generate high quality IDs that are guaranteed to be universally unique.
WitsmlServer.setIdGenerator(IdGenerator)
Modifier and Type | Method and Description |
---|---|
String |
generateId(String witsmlType,
String name,
WitsmlObject parent,
String defaultId)
This method is called before a new instance is created
in order to assign a unique ID to that instance.
|
String generateId(String witsmlType, String name, WitsmlObject parent, String defaultId)
witsmlType
- WITSML type of the instance to create. Null if not top level type.name
- Name of the instance to create, May be null if not
supported by the given type.parent
- Parent instance. null if at root level.defaultId
- The default ID as generated by JWitsml.Copyright © 2023 Petroware AS - https://petroware.no