API idgen - RapturePlatform/Rapture GitHub Wiki
A idGen is a unique number generator - once defined it can be used to create unique ids that can be attached to documents or entities. idGens can be attached to a document repository so that new documents created in that repository can optionally have unique ids.
HttpIdGenApi idgenApi = new HttpIdGenApi(loginApi);
List<RaptureIdGenConfig> retVal = idgenApi.getIdGenConfigs(authority);
retVal = baseAPI.doIdGen_GetIdGenConfigs(authority);
Entitlement: /admin/idgen
Gets a list of idGens that have the given authority. Each idGen has a URI, and the authority is part of the URI. idGens whose URIs have an authority that matches the passed parameter will be returned.
Parameter | Type | Description |
---|---|---|
authority | String |
Type | Description |
---|---|
List |
HttpIdGenApi idgenApi = new HttpIdGenApi(loginApi);
RaptureIdGenConfig retVal = idgenApi.getIdGenConfig(idGenUri);
retVal = baseAPI.doIdGen_GetIdGenConfig(idGenUri);
Entitlement: /admin/idgen
Retrieves a single idGen config given its name.
Parameter | Type | Description |
---|---|---|
idGenUri | String |
Type | Description |
---|---|
RaptureIdGenConfig |
Holds the config info for a idgen as described in the idgen API.
Field | Type |
---|---|
name | String |
config | String |
authority | String |
HttpIdGenApi idgenApi = new HttpIdGenApi(loginApi);
RaptureIdGenConfig retVal = idgenApi.createIdGen(idGenUri, config);
retVal = baseAPI.doIdGen_CreateIdGen(idGenUri, config);
Entitlement: /admin/idgen
This method is used to define a new idGen in a given authority. The config parameter defines the storage to be used for managing the idGen.
Parameter | Type | Description |
---|---|---|
idGenUri | String | |
config | String |
Type | Description |
---|---|
RaptureIdGenConfig |
Holds the config info for a idgen as described in the idgen API.
Field | Type |
---|---|
name | String |
config | String |
authority | String |
HttpIdGenApi idgenApi = new HttpIdGenApi(loginApi);
boolean retVal = idgenApi.idGenExists(idGenUri);
retVal = baseAPI.doIdGen_IdGenExists(idGenUri);
Entitlement: /admin/idgen
Returns true if the idGen was found.
Parameter | Type | Description |
---|---|---|
idGenUri | String |
Type | Description |
---|---|
boolean |
HttpIdGenApi idgenApi = new HttpIdGenApi(loginApi);
void retVal = idgenApi.deleteIdGen(idGenUri);
retVal = baseAPI.doIdGen_DeleteIdGen(idGenUri);
Entitlement: /admin/idgen
This method is used to delete a previously defined idGen.
Parameter | Type | Description |
---|---|---|
idGenUri | String |
Type | Description |
---|---|
void |
HttpIdGenApi idgenApi = new HttpIdGenApi(loginApi);
void retVal = idgenApi.setIdGen(idGenUri, count);
retVal = baseAPI.doIdGen_SetIdGen(idGenUri, count);
Entitlement: /admin/idgen
This method can be used to reset an idGen to a new id - all future requests will start from this new point.
Parameter | Type | Description |
---|---|---|
idGenUri | String | |
count | Long |
Type | Description |
---|---|
void |
HttpIdGenApi idgenApi = new HttpIdGenApi(loginApi);
String retVal = idgenApi.next(idGenUri);
retVal = baseAPI.doIdGen_Next(idGenUri);
Entitlement: /admin/idgen
This method is used to increment the idGen and returns a string that corresponds to the newly generated id.
Parameter | Type | Description |
---|---|---|
idGenUri | String |
Type | Description |
---|---|
String |
HttpIdGenApi idgenApi = new HttpIdGenApi(loginApi);
String retVal = idgenApi.nextIds(idGenUri, num);
retVal = baseAPI.doIdGen_NextIds(idGenUri, num);
Entitlement: /admin/idgen
This method is used to increment the idGen by given amount and returns a string that corresponds to the newly generated id.
Parameter | Type | Description |
---|---|---|
idGenUri | String | |
num | Long |
Type | Description |
---|---|
String |
HttpIdGenApi idgenApi = new HttpIdGenApi(loginApi);
void retVal = idgenApi.setupDefaultIdGens(force);
retVal = baseAPI.doIdGen_SetupDefaultIdGens(force);
Entitlement: /admin/lock
Sets up any idGens needed by Rapture by default, should be called from any startup scripts. If force is set to true, it will force the configto be set up again, even if it already exists.
Parameter | Type | Description |
---|---|---|
force | boolean |
Type | Description |
---|---|
void |