public class DataDictionary extends AbstractListModel
Modifier and Type | Field and Description |
---|---|
static int |
FIELD_ID_RANGE1_END |
static int |
FIELD_ID_RANGE2_START |
static int |
INVALID_FIELD_ID |
static int |
MAX_FIELD_ID |
static Integer |
MAX_FIELD_INTEGER |
static int |
MIN_FIELD_ID |
listenerList
Constructor and Description |
---|
DataDictionary(PortalContext context)
Constructor will load all the fields and classes from the database.
|
DataDictionary(PortalContext context,
boolean init)
Constructor
Uses command line arguments passed from main()
|
Modifier and Type | Method and Description |
---|---|
void |
addClassToDDClassHashtable(DDClass ddObj)
Adding the newly created classes to the HashTable which contains
all the existing storable class in the data-base
|
boolean |
checkClassExists(String name)
Check if the class exists or not.
|
String |
checkForBaseClassExistence(String name)
Deprecated.
Please use
getParentClass(String) instead. |
void |
close()
Close the connection used to create this data dictionary
|
void |
commitNewFieldToDD(FList inFlist)
Create a new custom defined field
|
void |
createNewClass(FList inFlist)
Commiting a new class to data dictionary
|
Vector |
getAllClasses() |
DDClass |
getBaseClass(String name)
Retrieve the name of the base class
|
long |
getDatabaseNumber() |
DDClass |
getDDClass(String className) |
Vector |
getDDClasses(String className)
Get all classes of a type along with its extended classes,
i.e., for /service, also get /service/ip, /service/email,
/service/wireless/gsm, etc.
|
DDDatabase |
getDDDatabase() |
DDField |
getDDField(int index) |
Object |
getElementAt(int index)
Returns the field at the specified index.
|
FList |
getFListForClass(String className)
Get the data dictionary flist for the specified class.
|
static DataDictionary |
getInstance(PortalContext context)
Factory method to return a single instance of a DataDictionary
fully initialized.
|
String |
getName(int index) |
int |
getNextAvailFieldID()
Get the next available ID for customer created fields.
|
DDClass |
getParentClass(String name)
Retrieve the name of the parent class
|
Poid |
getPoid(String objectType) |
boolean |
getPortalFieldIDsEnabled()
Check if reserved Portal Field IDs are enabled.
|
int |
getSize() |
int |
getTypeIndex(int index) |
void |
init()
load all the fields and classes from the database.
|
protected void |
initAllClasses()
Get all classes from DB, initialize class hash map
|
void |
initAllFields()
Extracts all available fields from data-base
|
protected void |
initErrorLog()
Create log
|
protected void |
initFieldsVector(FList outFlist) |
boolean |
isFieldIDUsed(int number)
Varifying if the field ID is existing in the data-base
|
boolean |
isFieldIDValid(int number)
Verify a field ID is in a range reserved for Custom Fields.
|
boolean |
isFieldNameUsed(String fieldName)
Varifying if the field name is existing in the data-base
|
ArrayList |
loadDDClasses(String className)
Load the specified class and subclasses from the database.
|
void |
refresh()
Refresh the data dictionary
|
void |
setDDClassHashtable(Hashtable hashtable) |
void |
setPortalFieldIDsEnabled(boolean enabled)
Set if Portal Field IDs are enabled.
|
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
public static final int MIN_FIELD_ID
public static final int MAX_FIELD_ID
public static final int FIELD_ID_RANGE1_END
public static final int FIELD_ID_RANGE2_START
public static final Integer MAX_FIELD_INTEGER
public static final int INVALID_FIELD_ID
public DataDictionary(PortalContext context) throws EBufException
context
- the context from which to create this data dictionary.EBufException
- if there's a problem loading the data dictionary.public DataDictionary(PortalContext context, boolean init) throws EBufException
context
- the context from which to create this data dictionary.init
- if true this constructor will load all the fields and classes
from the database. If false then load only the fields, in which case many
of the methods will not work.EBufException
- if there's a problem loading the the fields and
classes.public static DataDictionary getInstance(PortalContext context) throws EBufException
A
- connection to Portal through which the DataDictionary will
be readEBufException
public void init() throws EBufException
EBufException
public void refresh() throws EBufException
EBufException
public ArrayList loadDDClasses(String className) throws EBufException
className
- EBufException
public void close() throws EBufException
EBufException
public DDDatabase getDDDatabase() throws EBufException
EBufException
public FList getFListForClass(String className) throws EBufException
className
- EBufException
protected void initErrorLog()
public void initAllFields() throws EBufException
EBufException
protected void initAllClasses() throws EBufException
EBufException
protected void initFieldsVector(FList outFlist) throws EBufException
EBufException
public boolean isFieldIDUsed(int number)
public boolean isFieldNameUsed(String fieldName)
public int getSize()
public Object getElementAt(int index)
index
- an index into this list.ArrayIndexOutOfBoundsException
- if the index
is negative or not less than the current size of this
list.public DDField getDDField(int index)
public long getDatabaseNumber()
public int getTypeIndex(int index) throws EBufException
EBufException
public String getName(int index) throws EBufException
EBufException
public boolean getPortalFieldIDsEnabled()
public void addClassToDDClassHashtable(DDClass ddObj) throws EBufException
ddclassObj
- DDClass object that is to be added to HashtableEBufException
public void setDDClassHashtable(Hashtable hashtable)
public DDClass getDDClass(String className) throws EBufException
EBufException
public Vector getDDClasses(String className) throws EBufException
className
- Name of the class that you want to retrieve
all its extensions.EBufException
public void commitNewFieldToDD(FList inFlist) throws EBufException
EBufException
public void createNewClass(FList inFlist) throws EBufException
EBufException
public DDClass getBaseClass(String name) throws EBufException
Example of using this method
... String name = "/service/ip/foo"; DDClass classObj = null; try { classObj = dDictionary.getBaseClass(className); } catch (EBufException e) { your exception handling code goes here }
name
- The name of the class for which the base class name will be
retrieved. The input string format needs to be "/foo/bar".null
if base class does not exist.EBufException
public DDClass getParentClass(String name) throws EBufException
Example of using this method
... String name = "/service/ip/foo"; DDClass classObj = null; try { classObj = dDictionary.getBaseClass(className); } catch (EBufException e) { your exception handling code goes here }
name
- The name of the class for which the parent class name will be
retrieved.null
if parent class does not exist.EBufException
public String checkForBaseClassExistence(String name) throws EBufException
getParentClass(String)
instead.name
- The name of the class for which the base class existence will be
checked.null
if the base class exists.
If the base class does not exist, return its name.EBufException
public boolean checkClassExists(String name)
name
- The name of the class for which the class existence will be
checked.true
if the class exists.
false
if the class does not exist.public void setPortalFieldIDsEnabled(boolean enabled)
True
- if enabled.public boolean isFieldIDValid(int number)
id
- Field ID to verfiy.public int getNextAvailFieldID()
public Vector getAllClasses() throws EBufException
EBufException
Copyright © 2003, 2023, Oracle and/or its affiliates.