|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.tivoli.twg.engine.TWGObject
com.tivoli.twg.engine.TWGPersistentObject
com.tivoli.twg.engine.TWGAssociation
Base class for association functions. This abstract class defines
the core interface and core attributes for an association, including
the necessary interfaces for activating and deactivating an
association, as well as notifying an association of the creation,
deletion, or modification of the TWGManagedObject
in the
TWGManagedObjectSet
providing the input to the association (which
is used by the association instance to product and maintain a
TWGRelationshipSet
).
Each TWGAssociation
subclass registered is used to construct
a single instance of the subclass. This instance can be used to
maintian zero or more TWGRelationshipSet
instances, so
implementation of the evaluateNewAndChangedObjects()
method
by the subclass is required to be reentrant with respect to the different
TWGRelationshipSet
instances.
When an association is first selected for a given set of
TWGManagedObjects
, the evaluateNewAndChangedObject()
method will be invoked with an empty TWGRelationshipSet
and the
add_set
containing all the persistent object IDs of the
TWGManagedObjects
initially to be considered. The
evaluateNewAndChangedObject()
method implementation is
responsible for evaluating these TWGManagedObjects
, and
adding them to the appropriate TWGRelationship
instances in
the TWGRelationshipSet
(and creating these
TWGRelationship
instances, as required).
When the population of TWGManagedObjects
to be considered by
the TWGAssociation
changes, either due to creation of one or more
new TWGManagedObjects
or potential changes in the characteristics
of one or more previously considered TWGManagedObjects
(i.e.
inventory refresh, operating system change, etc), the
evaluateNewAndChangedObject()
method will again be invoked,
with the add_set
containing the persistent object IDs of
any new TWGManagedObjects
(i.e. ones not
previously considered) and the chg_set
containing the
persistent object IDs of any changed TWGManagedObjects
(ones which may already be in one or more TWGRelationships
).
The TWGRelationshipSet
passed in will still
contain the TWGRelationships
previously added, so the
evaluateNewAndChangedObject()
method is responsible for updating
these existing TWGRelationships
(i.e. adding new members,
removing changed members which no longer match), as well as creating
new ones. Deleted TWGManagedObjects
are automatically removed from
all TWGRelationships
without invoking
evaluateNewAndChangedObject()
.
The TWGAssociation
instances must not maintain references to any
TWGRelationship
, IntValueSet
or
TWGRelationshipSet
parameters passed
or returned, as these are frequently reused and deleted without notice.
TWGManagedObject
,
TWGRelationship
,
TWGRelationshipSet
,
IntValueSet
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_NONE_ASSOC_ID
ID of default "none" association |
Fields inherited from class com.tivoli.twg.engine.TWGPersistentObject |
---|
CLASS_NAME, SIZEOF_BYTE, SIZEOF_CHAR, SIZEOF_DOUBLE, SIZEOF_FLOAT, SIZEOF_INT, SIZEOF_LONG, SIZEOF_SHORT |
Constructor Summary | |
---|---|
TWGAssociation()
Default constructor : used by restoreData() : must be
provided by any subclasses of TWGAssociation . |
Method Summary | |
---|---|
void |
Delete()
Delete method : use to remove object from list |
void |
evaluateNewAndChangedObjects(TWGRelationshipSet rel,
IntValueSet add_set,
IntValueSet chg_set,
TWGManagedObjectSet mos)
Primary functional evaluation method for association object: for the given relationship set, process added and modified managed objects, updating and modifying the relationship set appropriately. |
static TWGAssociation |
findByIDString(java.lang.String id)
Find association instance by ID string |
java.lang.String |
GetConShadowClass()
Get name of console shadow class. |
java.lang.String |
getExtensionClassName()
Get the name of the extension class that defined this association. |
java.lang.String |
getIDString()
Get ID string |
int |
getMenuWeight()
Get menu weight |
java.lang.String |
getName()
Get name (default locale) |
java.lang.String |
getName(java.util.Locale loc)
Get name (given locale) |
byte[] |
GetShadowRecord(java.util.Locale locale)
Get buffer containing current values of the shadowed attributes to be delivered to the console shadow class. |
long |
GetShadowVersion()
Get object state version. |
static void |
initBuiltInAssociations()
Initialize built-in associations, if needed. |
boolean |
isDatabaseDependent()
Test to see if association depends upon active database. |
boolean |
isDisabled()
Check to see if association is disabled |
boolean |
isLicenseDisabled()
Check to see if association is disabled due to license restriction |
protected void |
restoreData(TWGPersistentObjectDictionary dict,
boolean do_references)
Restore method for persistent object |
protected void |
saveData(TWGPersistentObjectDictionary dict)
Save method for saving persistent state |
void |
setExtensionClassName(java.lang.String extensionClassName)
Set the name of the extension class that defined this association. |
boolean |
setIDString(java.lang.String new_id)
Set ID string. |
void |
setMenuWeight(int new_w)
Set menu weight : menu weights are used for ordering different TWGAssociation names under the "Associations" menu. |
void |
setName(java.lang.String n)
Set name of association |
void |
setName(java.lang.String nameid,
java.lang.String namerb)
Set name of association using resouce bundle name and ID |
java.lang.String |
toString()
Returns a string representation of the object. |
void |
UpdateShadowVersion()
Update object state version. |
Methods inherited from class com.tivoli.twg.engine.TWGPersistentObject |
---|
Destroy, enableAsyncWrites, fromPersistID, initialize, isNewPersistentStore, isSaveRequired, PersistID, restore, restoreAll, save, save, setSaveRequired, terminate, toPersistID |
Methods inherited from class com.tivoli.twg.engine.TWGObject |
---|
AllObjects, AllObjects, DumpTWGObjects, FindObject, isDeleted, isNewObject, isPersistent, isPersistent, isValid, isValid, ObjectID, setDistinctObjectID, SetObjectID |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String DEFAULT_NONE_ASSOC_ID
Constructor Detail |
public TWGAssociation()
restoreData()
: must be
provided by any subclasses of TWGAssociation
.
Method Detail |
public void Delete()
Delete
in class TWGObject
protected void saveData(TWGPersistentObjectDictionary dict) throws TWGPersistentObjectSaveException
saveData
in class TWGPersistentObject
dict
- - dictionary to hold saved data
TWGPersistentObjectSaveException
- if save abortedprotected void restoreData(TWGPersistentObjectDictionary dict, boolean do_references) throws TWGPersistentObjectRestoreException
restoreData
in class TWGPersistentObject
dict
- - dictionary containing persistent object recordsdo_references
- - true if second pass (reference restores)
TWGPersistentObjectRestoreException
- if restore abortedpublic java.lang.String getName()
public java.lang.String getName(java.util.Locale loc)
loc
- - locale to get name relative to
public void setName(java.lang.String n)
n
- - new namepublic void setName(java.lang.String nameid, java.lang.String namerb)
nameid
- - identifier for namenamerb
- - name of resouce bundle containing namepublic int getMenuWeight()
public void setMenuWeight(int new_w)
TWGAssociation
names under the "Associations" menu.
new_w
- - new menu weightpublic final java.lang.String getExtensionClassName()
public final void setExtensionClassName(java.lang.String extensionClassName)
public void UpdateShadowVersion()
UpdateShadowVersion
in interface TWGBaseShadowedObject
public long GetShadowVersion()
GetShadowVersion
in interface TWGBaseShadowedObject
public java.lang.String GetConShadowClass()
GetConShadowClass
in interface TWGBaseShadowedObject
public byte[] GetShadowRecord(java.util.Locale locale)
GetShadowRecord
in interface TWGBaseShadowedObject
locale
- - Locale of requested data
public java.lang.String getIDString()
public boolean setIDString(java.lang.String new_id)
new_id
- - new ID string (must be unique)
public java.lang.String toString()
Object.toString()
public static TWGAssociation findByIDString(java.lang.String id)
id
- - ID string to search for
public static void initBuiltInAssociations() throws TWGPersistentObjectSaveException
Internal use only.
TWGPersistentObjectSaveException
- if error
saving new objects
TWGPersistentObjectSaveException
public void evaluateNewAndChangedObjects(TWGRelationshipSet rel, IntValueSet add_set, IntValueSet chg_set, TWGManagedObjectSet mos)
rel
- - TWGRelationshipSet
to be maintaintedadd_set
- - IntValueSet
of persistent IDs for the
TWGManagedObjects
which
have been added to the TWGManagedObjectSet
which was
used to produce the TWGRelationshipSet
chg_set
- - IntValueSet
of persistent IDs for the
TWGManagedObjects
which have been changed (and were
previously in the TWGManagedObjectSet
used for the
TWGRelationshipSet
).mos
- - TWGManagedObjectSet
containing full
population of persistent object IDs of TWGManagedObjects
for TWGRelationshipSet
(with changes already applied).public final boolean isDisabled()
public final boolean isLicenseDisabled()
public boolean isDatabaseDependent()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |