com.ecebs.rtd.enabler.types.itso
Interface Product

All Superinterfaces:
Serializable
All Known Implementing Classes:
CorruptIPE, CyclicLog, EntitlementIPE, IPE, Type14, Type16, Type2, Type22, Type23, Type24, Type27, Type28, Type29, UnsupportedIPE

public interface Product
extends Serializable

Represents a product found an ITSO CM. This can be either an IPE or a CyclicLog. The following check can be used to determine the type:

 Product product;
 ...
 if(product instanceof IPE){
        // product is an IPE
        IPE ipe = (IPE) product;
        // do something with it
 } else {
        // product is a Cyclic Log
        CyclicLog log = (CyclicLog) product;
        // do something with it
 }
 

Once a product is determined to be an IPE, further checks must be carried out to determine what type of IPE it is:

 // Need to check if the IPE is corrupt
 if(product instanceof CorruptIPE){
        // IPE is corrupt, handle it
 } else {
        // Not corrupt, can determine type based on the type in the directory entry
        switch(ipe.getDirEntry().getTYP()){
                case 2:
                        Type2 type2 = (Type2) product;
                        // handle it
                        break;
                case 14:
                        Type14 type14 = (Type14) product;
                        // handle it
                        break;
                case 16:
                        Type16 type16 = (Type16) product;
                        // handle it
                        break;
                case 22:
                        Type22 type22 = (Type22) product;
                        // handle it
                        break;
                case 23:
                        Type23 type23 = (Type23) product;
                        // handle it
                        break;
                case 24:
                        Type24 type24 = (Type24) product;
                        // handle it
                        break;
                case 27:
                        Type27 type27 = (Type27) product;
                        // handle it
                        break;
                case 28:
                        Type28 type28 = (Type28) product;
                        // handle it
                        break;
                case 29:
                        Type29 type29 = (Type29) product;
                        // handle it
                        break;
                default:
                        // IPE is not of a supported type
                        UnsupportedIPE unsupported = (UnsupportedIPE) product;
                        // handle it
                        break;
        }
 }
 

Author:
kyleb

Method Summary
 DirEntry getDirEntry()
          Get the directory entry associated with the product
 

Method Detail

getDirEntry

DirEntry getDirEntry()
Get the directory entry associated with the product

Returns:
Associated directory entry


Copyright © 2013 Ecebs Ltd. All Rights Reserved.