2009-10-01 1.2.0

org.eclipse.soda.dk.epcglobal.llrp.helper.idmanager
Class AbstractLLRPIdManager

java.lang.Object
  extended by org.eclipse.soda.dk.epcglobal.llrp.helper.idmanager.AbstractLLRPIdManager
All Implemented Interfaces:
IIdManager
Direct Known Subclasses:
AccessSpecIdManager, ROSpecIdManager

public abstract class AbstractLLRPIdManager
extends java.lang.Object
implements IIdManager

Since:
1.0
Version:
1.2.0

Field Summary
protected static int DEFAULT_START
          Define the default start (int) constant.
protected static java.lang.String OWNER_KEY
          Define the owner key (String) constant.
protected static java.lang.String STATUS_KEY
          Define the status key (String) constant.
protected static int UNLIMITED
          Define the unlimited (int) constant.
 
Fields inherited from interface org.eclipse.soda.dk.epcglobal.llrp.helper.idmanager.IIdManager
RESULT_IDUSED, RESULT_INVALID, RESULT_NOT_FOUND, RESULT_OVERLIMIT, RESULT_SUCCESS, STATUS_DISABLE_REQUESTED, STATUS_STANDBY, STATUS_STANDBY_NEW, STATUS_START_REQUESTED, STATUS_STARTED, STATUS_STOP_REQUESTED, STATUS_STOPPED
 
Constructor Summary
protected AbstractLLRPIdManager()
          Constructs an instance of this class.
protected AbstractLLRPIdManager(int startId, int maxIdNum)
          Constructs an instance of this class from the specified start id and max id num parameters.
 
Method Summary
protected  java.util.Map createIDContentMap(java.lang.Object idObj, java.lang.Object owner, int status)
          Create idcontent map with the specified owner and status parameters and return the Map result.
protected abstract  java.lang.Object createIdObj(int id)
          Create id obj with the specified id parameter and return the Object result.
protected abstract  int extractId(java.lang.Object idObj)
          Extract id with the specified id obj parameter and return the int result.
 java.util.List getIds(java.lang.Object owner)
          Get ids with the specified owner parameter and return the List result.
 int getIdStatus(int id, java.lang.Object owner)
          Get id status with the specified id and owner parameters and return the int result.
protected  int getIdStatus(java.lang.Object idObj)
          Get id status with the specified id obj parameter and return the int result.
 int getIdStatus(java.lang.Object idObj, java.lang.Object owner)
          Get id status with the specified id obj and owner parameters and return the int result.
 int getMaxIdNum()
          Gets the max ID num (int) value.
 java.lang.Object getOwner(int id)
          Get owner with the specified id parameter and return the Object result.
 java.lang.Object getOwner(java.lang.Object idObj)
          Get owner with the specified id obj parameter and return the Object result.
 int getStartId()
          Gets the start ID (int) value.
 boolean isAllIdsStarted(java.lang.Object owner)
          Is all ids started with the specified owner parameter and return the boolean result.
 boolean isAllIdsStopped(java.lang.Object owner)
          Is all ids stopped with the specified owner parameter and return the boolean result.
 int registerId(int id, java.lang.Object owner)
          Register id with the specified id and owner parameters and return the int result.
 int registerId(java.lang.Object idObj, java.lang.Object owner)
          Register id with the specified id obj and owner parameters and return the int result.
 int registerNextId(java.lang.Object owner)
          Register next id with the specified owner parameter and return the int result.
 void removeId(java.lang.Object idObj)
          Remove id with the specified id obj parameter.
 void removeIdsByOwner(java.lang.Object owner)
          Remove ids by owner with the specified owner parameter.
 void reset()
          Reset.
 int setIdStatus(int id, java.lang.Object owner, int status)
          Set id status with the specified id, owner and status parameters and return the int result.
 int setIdStatus(java.lang.Object idObj, java.lang.Object owner, int status)
          Set id status with the specified id obj, owner and status parameters and return the int result.
 void setMaxIdNum(int maxIdNum)
          Sets the max ID num value.
 void setStartId(int startId)
          Sets the start ID value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_START

protected static final int DEFAULT_START
Define the default start (int) constant.

See Also:
Constant Field Values

UNLIMITED

protected static final int UNLIMITED
Define the unlimited (int) constant.

See Also:
Constant Field Values

OWNER_KEY

protected static final java.lang.String OWNER_KEY
Define the owner key (String) constant.

See Also:
Constant Field Values

STATUS_KEY

protected static final java.lang.String STATUS_KEY
Define the status key (String) constant.

See Also:
Constant Field Values
Constructor Detail

AbstractLLRPIdManager

protected AbstractLLRPIdManager()
Constructs an instance of this class.


AbstractLLRPIdManager

protected AbstractLLRPIdManager(int startId,
                                int maxIdNum)
Constructs an instance of this class from the specified start id and max id num parameters.

Parameters:
startId - The start ID (int) parameter.
maxIdNum - The max ID num (int) parameter.
Method Detail

createIDContentMap

protected java.util.Map createIDContentMap(java.lang.Object idObj,
                                           java.lang.Object owner,
                                           int status)
Create idcontent map with the specified owner and status parameters and return the Map result.

Parameters:
idObj - The ID obj (Object) parameter.
owner - The owner (Object) parameter.
status - The status (int) parameter.
Returns:
Results of the create idcontent map (Map) value.

createIdObj

protected abstract java.lang.Object createIdObj(int id)
Create id obj with the specified id parameter and return the Object result.

Parameters:
id - The ID (int) parameter.
Returns:
Results of the create id obj (Object) value.
See Also:
#getIdObj()

extractId

protected abstract int extractId(java.lang.Object idObj)
Extract id with the specified id obj parameter and return the int result.

Parameters:
idObj - The ID obj (Object) parameter.
Returns:
Results of the extract id (int) value.
See Also:
#getId()

getIdStatus

protected int getIdStatus(java.lang.Object idObj)
Get id status with the specified id obj parameter and return the int result.

Parameters:
idObj - The ID obj (Object) parameter.
Returns:
Results of the get id status (int) value.

getIdStatus

public int getIdStatus(java.lang.Object idObj,
                       java.lang.Object owner)
Get id status with the specified id obj and owner parameters and return the int result.

Specified by:
getIdStatus in interface IIdManager
Parameters:
idObj - The ID obj (Object) parameter.
owner - The owner (Object) parameter.
Returns:
Results of the get id status (int) value.
See Also:
IIdManager.getIdStatus(int,Object), IIdManager.setIdStatus(Object,Object,int), IIdManager.setIdStatus(int,Object,int)

getIdStatus

public int getIdStatus(int id,
                       java.lang.Object owner)
Get id status with the specified id and owner parameters and return the int result.

Specified by:
getIdStatus in interface IIdManager
Parameters:
id - The ID (int) parameter.
owner - The owner (Object) parameter.
Returns:
Results of the get id status (int) value.
See Also:
IIdManager.getIdStatus(Object,Object), IIdManager.setIdStatus(Object,Object,int), IIdManager.setIdStatus(int,Object,int)

getIds

public java.util.List getIds(java.lang.Object owner)
Get ids with the specified owner parameter and return the List result.

Specified by:
getIds in interface IIdManager
Parameters:
owner - The owner (Object) parameter.
Returns:
Results of the get ids (List) value.

getMaxIdNum

public int getMaxIdNum()
Gets the max ID num (int) value.

Returns:
The max id num (int) value.

getOwner

public java.lang.Object getOwner(java.lang.Object idObj)
Get owner with the specified id obj parameter and return the Object result.

Specified by:
getOwner in interface IIdManager
Parameters:
idObj - The ID obj (Object) parameter.
Returns:
Results of the get owner (Object) value.
See Also:
IIdManager.getOwner(int), IIdManager.removeIdsByOwner(Object)

getOwner

public java.lang.Object getOwner(int id)
Get owner with the specified id parameter and return the Object result.

Specified by:
getOwner in interface IIdManager
Parameters:
id - The ID (int) parameter.
Returns:
Results of the get owner (Object) value.
See Also:
IIdManager.getOwner(Object), IIdManager.removeIdsByOwner(Object)

getStartId

public int getStartId()
Gets the start ID (int) value.

Returns:
The start id (int) value.

isAllIdsStarted

public boolean isAllIdsStarted(java.lang.Object owner)
Is all ids started with the specified owner parameter and return the boolean result.

Specified by:
isAllIdsStarted in interface IIdManager
Parameters:
owner - The owner (Object) parameter.
Returns:
Results of the is all ids started (boolean) value.

isAllIdsStopped

public boolean isAllIdsStopped(java.lang.Object owner)
Is all ids stopped with the specified owner parameter and return the boolean result.

Specified by:
isAllIdsStopped in interface IIdManager
Parameters:
owner - The owner (Object) parameter.
Returns:
Results of the is all ids stopped (boolean) value.

registerId

public int registerId(java.lang.Object idObj,
                      java.lang.Object owner)
Register id with the specified id obj and owner parameters and return the int result.

Specified by:
registerId in interface IIdManager
Parameters:
idObj - The ID obj (Object) parameter.
owner - The owner (Object) parameter.
Returns:
Results of the register id (int) value.
See Also:
#getId()

registerId

public int registerId(int id,
                      java.lang.Object owner)
Register id with the specified id and owner parameters and return the int result.

Specified by:
registerId in interface IIdManager
Parameters:
id - The ID (int) parameter.
owner - The owner (Object) parameter.
Returns:
Results of the register id (int) value.
See Also:
#getId()

registerNextId

public int registerNextId(java.lang.Object owner)
Register next id with the specified owner parameter and return the int result.

Specified by:
registerNextId in interface IIdManager
Parameters:
owner - The owner (Object) parameter.
Returns:
Results of the register next id (int) value.

removeId

public void removeId(java.lang.Object idObj)
Remove id with the specified id obj parameter.

Specified by:
removeId in interface IIdManager
Parameters:
idObj - The ID obj (Object) parameter.
See Also:
#getId()

removeIdsByOwner

public void removeIdsByOwner(java.lang.Object owner)
Remove ids by owner with the specified owner parameter.

Specified by:
removeIdsByOwner in interface IIdManager
Parameters:
owner - The owner (Object) parameter.

reset

public void reset()
Reset.

Specified by:
reset in interface IIdManager

setIdStatus

public int setIdStatus(int id,
                       java.lang.Object owner,
                       int status)
Set id status with the specified id, owner and status parameters and return the int result.

Specified by:
setIdStatus in interface IIdManager
Parameters:
id - The ID (int) parameter.
owner - The owner (Object) parameter.
status - The status (int) parameter.
Returns:
Results of the set id status (int) value.
See Also:
IIdManager.getIdStatus(Object,Object), IIdManager.getIdStatus(int,Object), IIdManager.setIdStatus(Object,Object,int)

setIdStatus

public int setIdStatus(java.lang.Object idObj,
                       java.lang.Object owner,
                       int status)
Set id status with the specified id obj, owner and status parameters and return the int result.

Specified by:
setIdStatus in interface IIdManager
Parameters:
idObj - The ID obj (Object) parameter.
owner - The owner (Object) parameter.
status - The status (int) parameter.
Returns:
Results of the set id status (int) value.
See Also:
IIdManager.getIdStatus(Object,Object), IIdManager.getIdStatus(int,Object), IIdManager.setIdStatus(int,Object,int)

setMaxIdNum

public void setMaxIdNum(int maxIdNum)
Sets the max ID num value.

Specified by:
setMaxIdNum in interface IIdManager
Parameters:
maxIdNum - The max ID num (int) parameter.

setStartId

public void setStartId(int startId)
Sets the start ID value.

Specified by:
setStartId in interface IIdManager
Parameters:
startId - The start ID (int) parameter.

2009-10-01 1.2.0

Copyright (c) 2009 IBM. See license in Legal section.