summaryrefslogtreecommitdiff
path: root/src/main/java/com/c2kernel/lookup/NextKeyManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/c2kernel/lookup/NextKeyManager.java')
-rw-r--r--src/main/java/com/c2kernel/lookup/NextKeyManager.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/main/java/com/c2kernel/lookup/NextKeyManager.java b/src/main/java/com/c2kernel/lookup/NextKeyManager.java
index a4ead4b..9aea50d 100644
--- a/src/main/java/com/c2kernel/lookup/NextKeyManager.java
+++ b/src/main/java/com/c2kernel/lookup/NextKeyManager.java
@@ -28,14 +28,14 @@ public class NextKeyManager {
this.lastKeyPath = lastKeyPath;
}
- public synchronized EntityPath generateNextEntityKey()
+ public synchronized ItemPath generateNextEntityKey()
throws ObjectCannotBeUpdated, ObjectNotFoundException
{
- EntityPath lastKey = getLastEntityPath();
+ ItemPath lastKey = getLastEntityPath();
try {
lastKey.setSysKey(lastKey.getSysKey()+1);
- } catch (InvalidEntityPathException ex) {
+ } catch (InvalidItemPathException ex) {
throw new ObjectCannotBeUpdated("Invalid syskey "+(lastKey.getSysKey()+1)+". Maybe centre is full.");
}
//test that storage is empty for that key
@@ -56,7 +56,7 @@ public class NextKeyManager {
public synchronized AgentPath generateNextAgentKey()
throws ObjectCannotBeUpdated, ObjectNotFoundException {
- EntityPath newEntity = generateNextEntityKey();
+ ItemPath newEntity = generateNextEntityKey();
return new AgentPath(newEntity);
}
@@ -65,15 +65,15 @@ public class NextKeyManager {
LDAPLookupUtils.setAttributeValue(ldap.getConnection(), lastKeyEntry,"intsyskey",Integer.toString(sysKey));
}
- public EntityPath getLastEntityPath() throws ObjectNotFoundException
+ public ItemPath getLastEntityPath() throws ObjectNotFoundException
{
LDAPEntry lastKeyEntry = LDAPLookupUtils.getEntry(ldap.getConnection(),lastKeyPath);
String lastKey = LDAPLookupUtils.getFirstAttributeValue(lastKeyEntry,"intsyskey");
try {
int sysKey = Integer.parseInt(lastKey);
- EntityPath sysPath = new EntityPath(sysKey);
+ ItemPath sysPath = new ItemPath(sysKey);
return sysPath;
- } catch (InvalidEntityPathException ex) {
+ } catch (InvalidItemPathException ex) {
throw new ObjectNotFoundException("Invalid syskey. Maybe centre is full.");
} catch (NumberFormatException ex) {
throw new ObjectNotFoundException("Invalid syskey in lastkey.");