org.opensubsystems.inventory.persist
Interface IdentificationFactory

All Superinterfaces:
org.opensubsystems.core.persist.BasicDataFactory, org.opensubsystems.core.persist.DataFactory, org.opensubsystems.patterns.listdata.persist.ListFactory, org.opensubsystems.core.persist.ModifiableDataFactory
All Known Implementing Classes:
IdentificationDatabaseFactory

public interface IdentificationFactory
extends org.opensubsystems.core.persist.ModifiableDataFactory, org.opensubsystems.patterns.listdata.persist.ListFactory

This interface defines methods to create, retrieve and manipulate identifications.

Version:
$Id: IdentificationFactory.java,v 1.7 2007/01/07 06:14:31 bastafidli Exp $
Author:
Miro Halas
Code reviewer:
TODO: Review this code
Code reviewed:

Method Summary
 Identification create(Identification identification, boolean bCheckUnique)
          Create Identification in the persistance store.
 void create(java.util.List lstIdentifications, boolean bCheckUnique)
          Create list of Identifications in the persistance store.
 Identification get(int iInventoryId, java.lang.String strInternalNumber)
          Get specific identification identified by the number assigned to it by user, which should be unique in the inventory.
 java.util.Set getAllExternalNumbers(int iInventoryId)
          Get all manufacturer specified external numbers in inventory.
 java.util.Set getAllInternalNumbers(int iInventoryId)
          Get all user specified internal numbers for particular inventory.
 java.util.List getForItem(int iItemId)
          Get list with all identifications for specified item.
 java.lang.String getInternalNumberForExternalNumber(int iInventoryId, java.lang.String externalNumber)
          Get internal numbers for external number in inventory.
 java.lang.String getInternalNumberForNotUniquelyTracked(int iItemId)
          Return unique internal number associated with this non uniquely tracked item.
 java.lang.String getNextInternalNumber(int iInventoryId)
          Try to get the next internal number for particular inventory.
 int save(java.util.Collection colDataObject)
          Update collection of Identifications
 Identification save(Identification identification, boolean bCheckUnique)
          Updates Identification in the persistence store.
 void save(java.util.List lstIdentifications, boolean bCheckUnique)
          Update list of Identifications in the persistance store.
 void setAllRetired(int iInventoryId)
          Set all identifications in the inventory as retired since they should not be used anymore.
 void setRetired(java.util.Set idList)
          Set all identifications in the specified list as retired since they should not be used anymore.
 boolean verifyUniqueExternalNumber(Identification data, boolean checkName)
          Check external number, inventory, manufacturer is not used yet
 
Methods inherited from interface org.opensubsystems.core.persist.ModifiableDataFactory
save
 
Methods inherited from interface org.opensubsystems.core.persist.BasicDataFactory
create, create, delete
 
Methods inherited from interface org.opensubsystems.core.persist.DataFactory
get, getDataType
 
Methods inherited from interface org.opensubsystems.patterns.listdata.persist.ListFactory
get, getDefaultListDefinition
 

Method Detail

get

Identification get(int iInventoryId,
                   java.lang.String strInternalNumber)
                   throws org.opensubsystems.core.error.OSSException
Get specific identification identified by the number assigned to it by user, which should be unique in the inventory.

Parameters:
iInventoryId - - id of inventory to get the identification from TODO: Improve: Why are we saying it should be unique? Why we do not enforce the uniqueness
strInternalNumber - - internal number assigned to it by user which should be unique in the inventory
Returns:
ItemNumber - specified identification or null if it cannot be found
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured

create

Identification create(Identification identification,
                      boolean bCheckUnique)
                      throws org.opensubsystems.core.error.OSSException
Create Identification in the persistance store.

Parameters:
identification - - item number item to create
bCheckUnique - - if true external number has to be unique in the inventory
Returns:
Identification - newly created Identification
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured

save

Identification save(Identification identification,
                    boolean bCheckUnique)
                    throws org.opensubsystems.core.error.OSSException
Updates Identification in the persistence store.

Parameters:
identification - - Identification item to create
bCheckUnique - - if true external number has to be unique in the inventory
Returns:
Identification - newly created Identification
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured

create

void create(java.util.List lstIdentifications,
            boolean bCheckUnique)
            throws org.opensubsystems.core.error.OSSException
Create list of Identifications in the persistance store.

Parameters:
lstIdentifications - - list of Identification items to create
bCheckUnique - - if true external number has to be unique in the inventory
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured

save

void save(java.util.List lstIdentifications,
          boolean bCheckUnique)
          throws org.opensubsystems.core.error.OSSException
Update list of Identifications in the persistance store.

Parameters:
lstIdentifications - - list of Identification items to update
bCheckUnique - - if true external number has to be unique in the inventory
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured

save

int save(java.util.Collection colDataObject)
         throws org.opensubsystems.core.error.OSSException
Update collection of Identifications

Parameters:
colDataObject - - collection of identifications that have to be updated
Returns:
int - number of updated records
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured

getInternalNumberForNotUniquelyTracked

java.lang.String getInternalNumberForNotUniquelyTracked(int iItemId)
                                                        throws org.opensubsystems.core.error.OSSException
Return unique internal number associated with this non uniquely tracked item. Non uniquely tracked items are items, which cannot be distinguished from each other and therefore each individual item does not have specific internal number which identifies it. The whole group of items represented by this item have one number which can identify all and every one of them. This internal number is from Identification object for particular Item "found holder" Unit. Each item without external numbers (not uniquely tracked) have one and only one found holder unit with one Identification

Parameters:
iItemId - - item id
Returns:
String - internal number or null if the item is uniquelly tracked
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured

getNextInternalNumber

java.lang.String getNextInternalNumber(int iInventoryId)
                                       throws org.opensubsystems.core.error.OSSException
Try to get the next internal number for particular inventory. Function at first finds record with latest creation date in the specified inventory, then get its internal number. If the internal number is numeric (can be converted to number), return string with value equal to number + 1 otherwise return only string.

Parameters:
iInventoryId - - inventory id to get the next internal number from
Returns:
String - next number or string
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured

getForItem

java.util.List getForItem(int iItemId)
                          throws org.opensubsystems.core.error.OSSException
Get list with all identifications for specified item.

Parameters:
iItemId - - item id to get identification for
Returns:
List - list with Identification objects
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured

getAllInternalNumbers

java.util.Set getAllInternalNumbers(int iInventoryId)
                                    throws org.opensubsystems.core.error.OSSException
Get all user specified internal numbers for particular inventory.

Parameters:
iInventoryId - - inventory id to get the internal numbers for
Returns:
Set - set with all user specified internal numbers in the specified inventory
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured

getAllExternalNumbers

java.util.Set getAllExternalNumbers(int iInventoryId)
                                    throws org.opensubsystems.core.error.OSSException
Get all manufacturer specified external numbers in inventory.

Parameters:
iInventoryId - - inventory id to get the external numbers from
Returns:
Set - set with external numbers from the in the specified inventory
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured

getInternalNumberForExternalNumber

java.lang.String getInternalNumberForExternalNumber(int iInventoryId,
                                                    java.lang.String externalNumber)
                                                    throws org.opensubsystems.core.error.OSSException
Get internal numbers for external number in inventory.

Parameters:
iInventoryId - - inventory id
externalNumber - - external number
Returns:
String - internal number for external number or null if not found
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured

setAllRetired

void setAllRetired(int iInventoryId)
                   throws org.opensubsystems.core.error.OSSException
Set all identifications in the inventory as retired since they should not be used anymore.

Parameters:
iInventoryId - - id of inventory for Identifications
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured

setRetired

void setRetired(java.util.Set idList)
                throws org.opensubsystems.core.error.OSSException
Set all identifications in the specified list as retired since they should not be used anymore.

Parameters:
idList - - set with ids of Identification to set as retired
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured

verifyUniqueExternalNumber

boolean verifyUniqueExternalNumber(Identification data,
                                   boolean checkName)
                                   throws org.opensubsystems.core.error.OSSException
Check external number, inventory, manufacturer is not used yet

Parameters:
data - - data to check
checkName - - if true name have to be unique
Returns:
boolean - true if external number, inventory, manufacturer is already used
Throws:
org.opensubsystems.core.error.OSSException - - an error occured


Copyright © 2003 - 2006 OpenSubsystems s.r.o.