|
|||||||||||
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.TWGDistConfigRecordDef
Definition object for an application-specific configuration record. This persistent object defines the meta-data for a type of configuration record which will be stored, distributed, and managed by the TWGDistConfigManager. Each definition is required to provide a unchanging, unique ID token. Additional data determines which TWGManagedObject classes are supported, as well as whether the records should be replicated to the agents.
Applications may opt to subclass the TWGDistConfigRecordDef
class in order to provide a handler for the
handleUnsupportedDistConfigAgent()
method, which is invoked
when an instance of the configuration record needs to be sent
to a managed object which does not support the distributed
configuration agent extensions (i.e. ITD V1.x agents). Note: the superclass
version of the method must still be called.
Field Summary | |
---|---|
static int |
FLAGS_AGENT_OWNED_RECORDS
Capability flag : agent-owned record (as opposed to server-owned) |
static int |
FLAGS_GROUP_RECORDS_ALLOWED
Capability flag : group records allowed |
static int |
FLAGS_PUBLIC_UPDATE_ALLOWED
Capability flag : permit update by non-owning applications |
static int |
FLAGS_REFLECT_DATA_TO_AGENTS
Capability flag : reflect records to agent |
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 | |
---|---|
TWGDistConfigRecordDef()
Default constructor : used by restoreData() : must be
provided by any subclasses of TWGDistConfigRecordDef |
|
TWGDistConfigRecordDef(java.lang.String id,
java.lang.String[] mo_classes,
boolean copy_to_agents,
boolean public_record,
boolean group_records_allowed,
java.lang.String store_fname)
Creation constructor : used to create new distributed configuration record definition. |
|
TWGDistConfigRecordDef(java.lang.String id,
java.lang.String[] mo_classes,
boolean copy_to_agents,
boolean public_record,
boolean group_records_allowed,
java.lang.String store_fname,
boolean agent_owned_records)
Creation constructor : used to create new distributed configuration record definition. |
Method Summary | |
---|---|
void |
closeBagFile()
Close bagfile |
void |
Delete()
Destroy method : use to destroy record type and data |
static void |
deleteAllRecordsForObject(long obj_id)
Delete all records associated with given object ID |
void |
deregisterChangeListener(TWGDistConfigRecordChangeListener list)
Deregister listener for record updates and deletes |
void |
Destroy()
Delete method : use to remove object from list |
void |
distConfigAgentRecordDeleted(TWGManagedObject mo,
long obj_id)
Callback for reporting delete of specific record on specific managed object. |
void |
distConfigAgentRecordUpdated(TWGManagedObject mo,
long obj_id)
Callback for reporting add/update of specific record on specific managed object. |
static void |
enqueueAgentRecordSynchronize(TWGManagedObject mo)
Enqueue synchronize for given agent |
static void |
enqueueGroupRecordSynchronize(TWGFilter flt)
Enqueue synchronize for all members of given group |
static void |
enqueueUnsupportedAgentRecordSynchronize(TWGManagedObject mo)
Enqueue unsupported agent synchronize for given agent |
static TWGDistConfigRecordDef |
findByIDString(java.lang.String id)
Find record definition instance by ID string |
static TWGDistConfigRecordHashcode[] |
getAllHashcodesForObject(long obj_id)
Get all hashcodes for all records for given managed object (including groups containing managed object). |
static TWGDistConfigRecordHashcode[] |
getAllHashcodesForObject(long obj_id,
boolean only_agt_sync)
Get all hashcodes for all records for given managed object (including groups containing managed object). |
static TWGDistConfigRecord[] |
getAllRecordsForObject(long obj_id)
Get all records for given managed object (including groups containing managed object). |
static TWGDistConfigRecord[] |
getAllRecordsForObject(long obj_id,
boolean only_agt_sync)
Get all records for given managed object (including groups containing managed object). |
static byte[] |
getCompositeHashcodeForObject(long obj_id)
Get composite hashcode for all records for given managed object (including groups containing managed object). |
static byte[] |
getCompositeHashcodeForObject(long obj_id,
boolean only_agt_recs)
Get composite hashcode for all records for given managed object (including groups containing managed object). |
TWGDistConfigRecordHashcode[] |
getHashcodesForObject(long obj_id)
Get all hashcodes for given managed object (including groups containing managed object). |
java.lang.String |
getIDString()
Get ID string |
java.lang.String |
getName()
Get name (default locale) |
java.lang.String |
getName(java.util.Locale loc)
Get name (given locale) |
static byte[] |
getRecordDataForHashcodeRecord(TWGDistConfigRecordHashcode hcr)
Read data record for given hashcode record |
TWGDistConfigRecord |
getRecordForObject(long obj_id)
Get record for given object ID |
TWGDistConfigRecordHashcode |
getRecordHashcodeForObject(long obj_id)
Get hashcode for record for given object. |
TWGDistConfigRecord[] |
getRecordsForObject(long obj_id)
Get all records for given managed object (including groups containing managed object). |
java.io.File |
getRecordStorageFile()
Get file object for our attribute storage |
void |
handleUnsupportedDistConfigAgent(TWGManagedObject mo,
TWGDistConfigRecordHashcode[] recs,
DistConfigAgentResult result_listener)
Handler for attempts to copy records to a managed object instance which doesn't support configuration distribution (i.e. |
boolean |
isAgentOwned()
Test to see if record type is agent-owned (agent version is 'master') |
boolean |
isAgentSyncRecord()
Test to see if record type is synchronized with agent copy |
boolean |
isGroupRecordAllowed()
Test to see if group records allowed by record type |
BagFile |
openBagFile()
Open bagfile for use |
void |
registerChangeListener(TWGDistConfigRecordChangeListener list)
Register listener for record updates and deletes |
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 |
setName(java.lang.String n)
Set name of record definition |
void |
setName(java.lang.String nameid,
java.lang.String namerb)
Set name of record definition using resouce bundle name and ID |
void |
SetObjectID(long oid)
Set object ID. |
static void |
setRecord(TWGDistConfigRecord rec)
Add/replace record |
void |
setRecordForObjects(long[] obj_ids,
byte[] rec)
Add/replace record for given object IDs |
Methods inherited from class com.tivoli.twg.engine.TWGPersistentObject |
---|
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int FLAGS_REFLECT_DATA_TO_AGENTS
public static final int FLAGS_PUBLIC_UPDATE_ALLOWED
public static final int FLAGS_GROUP_RECORDS_ALLOWED
public static final int FLAGS_AGENT_OWNED_RECORDS
Constructor Detail |
public TWGDistConfigRecordDef()
restoreData()
: must be
provided by any subclasses of TWGDistConfigRecordDef
public TWGDistConfigRecordDef(java.lang.String id, java.lang.String[] mo_classes, boolean copy_to_agents, boolean public_record, boolean group_records_allowed, java.lang.String store_fname, boolean agent_owned_records) throws TWGPersistentObjectSaveException, DuplicateObjectIDException
id
- - unique ID for record definitionmo_classes
- - list of managed object classes supported (null=all)copy_to_agents
- - true if record should be replicated to agents, false if
only stored on serverpublic_record
- - true if record is "public" and can be copied or deleted
by other applications, false if "private" to defining applicationgroup_records_allowed
- - true if records can be tied to groups(TWGFilters),
false if only supports managed objects individuallystore_fname
- - filename for attribute storage on server : relative
to TWGEnvironment.getDataDirectory(). null="id
.dcf"agent_owned_records
- - indicates that agent version of records is "master" (
if mismatch occurs, agent version is used to update server). If false, server
version is "master" and is applied to agent. group_records_allowed must be
'false' and copy_to_agents must be 'true' if agent_owned_records is 'true'.
TWGPersistentObjectSaveException
- if error creating object
DuplicateObjectIDException
- if duplicate record IDpublic TWGDistConfigRecordDef(java.lang.String id, java.lang.String[] mo_classes, boolean copy_to_agents, boolean public_record, boolean group_records_allowed, java.lang.String store_fname) throws TWGPersistentObjectSaveException, DuplicateObjectIDException
id
- - unique ID for record definitionmo_classes
- - list of managed object classes supported (null=all)copy_to_agents
- - true if record should be replicated to agents, false if
only stored on serverpublic_record
- - true if record is "public" and can be copied or deleted
by other applications, false if "private" to defining applicationgroup_records_allowed
- - true if records can be tied to groups(TWGFilters),
false if only supports managed objects individuallystore_fname
- - filename for attribute storage on server : relative
to TWGEnvironment.getDataDirectory(). null="id
.dcf"
TWGPersistentObjectSaveException
- if error creating object
DuplicateObjectIDException
- if duplicate record IDMethod Detail |
public void SetObjectID(long oid) throws DuplicateObjectIDException
SetObjectID
in class TWGObject
oid
- - new object ID, or INVALID_OBJECT_ID if none
DuplicateObjectIDException
- if ID is duplicatepublic void Destroy() throws TWGObjectDestroyException
Destroy
in class TWGPersistentObject
TWGObjectDestroyException
- if error during destroypublic 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 java.lang.String getIDString()
public boolean isAgentSyncRecord()
public boolean isAgentOwned()
public boolean isGroupRecordAllowed()
public static TWGDistConfigRecordDef findByIDString(java.lang.String id)
id
- - ID string to search for
public java.io.File getRecordStorageFile()
public BagFile openBagFile() throws java.io.IOException
java.io.IOException
public void closeBagFile() throws java.io.IOException
java.io.IOException
public void handleUnsupportedDistConfigAgent(TWGManagedObject mo, TWGDistConfigRecordHashcode[] recs, DistConfigAgentResult result_listener)
mo
- - managed object to be distributed torecs
- - full set of record hashcodes for agentresult_listener
- - Listener to report results topublic TWGDistConfigRecord getRecordForObject(long obj_id) throws java.io.IOException
obj_id
- - object ID (either group or managed object ID)
java.io.IOException
- if error reading recordpublic static byte[] getRecordDataForHashcodeRecord(TWGDistConfigRecordHashcode hcr)
hcr
- - hashcode recordpublic void setRecordForObjects(long[] obj_ids, byte[] rec) throws java.io.IOException, InvalidObjectIDException
obj_ids
- - object IDs (groups or managed object ID)rec
- - record to be written : null=delete existing record
java.io.IOException
- if error writing record
InvalidObjectIDException
- if bad object IDpublic static void setRecord(TWGDistConfigRecord rec) throws java.io.IOException, InvalidObjectIDException
rec
- - record to be written : contains all other attributes
java.io.IOException
- if error writing record
InvalidObjectIDException
- if bad object IDpublic TWGDistConfigRecordHashcode getRecordHashcodeForObject(long obj_id) throws InvalidObjectIDException
obj_id
- - object ID (group or managed object ID)
InvalidObjectIDException
- if bad object IDpublic static byte[] getCompositeHashcodeForObject(long obj_id, boolean only_agt_recs) throws InvalidObjectIDException
obj_id
- - managed object ID
InvalidObjectIDException
- if bad object IDpublic static byte[] getCompositeHashcodeForObject(long obj_id) throws InvalidObjectIDException
obj_id
- - managed object ID
InvalidObjectIDException
- if bad object IDpublic static TWGDistConfigRecordHashcode[] getAllHashcodesForObject(long obj_id, boolean only_agt_sync) throws InvalidObjectIDException
obj_id
- - managed object IDonly_agt_sync
- - true if only agent copied records should be requested
InvalidObjectIDException
- if bad object IDpublic static TWGDistConfigRecordHashcode[] getAllHashcodesForObject(long obj_id) throws InvalidObjectIDException
obj_id
- - managed object ID
InvalidObjectIDException
- if bad object IDpublic TWGDistConfigRecordHashcode[] getHashcodesForObject(long obj_id) throws InvalidObjectIDException
obj_id
- - managed object ID
InvalidObjectIDException
- if bad object IDpublic static TWGDistConfigRecord[] getAllRecordsForObject(long obj_id, boolean only_agt_sync) throws InvalidObjectIDException, java.io.IOException
obj_id
- - managed object IDonly_agt_sync
- - true if only agent-copied records should be included
InvalidObjectIDException
- if bad object ID
java.io.IOException
- if error reading recordspublic static TWGDistConfigRecord[] getAllRecordsForObject(long obj_id) throws InvalidObjectIDException, java.io.IOException
obj_id
- - managed object ID
InvalidObjectIDException
- if bad object ID
java.io.IOException
- if error reading recordspublic TWGDistConfigRecord[] getRecordsForObject(long obj_id) throws InvalidObjectIDException, java.io.IOException
obj_id
- - managed object ID
InvalidObjectIDException
- if bad object ID
java.io.IOException
- if error reading recordspublic static void deleteAllRecordsForObject(long obj_id) throws java.io.IOException, InvalidObjectIDException
obj_id
- - object ID
java.io.IOException
InvalidObjectIDException
public static void enqueueAgentRecordSynchronize(TWGManagedObject mo)
mo
- - managed object to be sent updatepublic static void enqueueGroupRecordSynchronize(TWGFilter flt)
public static void enqueueUnsupportedAgentRecordSynchronize(TWGManagedObject mo)
mo
- - managed object to be sent updatepublic void distConfigAgentRecordUpdated(TWGManagedObject mo, long obj_id)
mo
- - managed object targetedobj_id
- - object ID for record (MO-ID or Group ID)public void distConfigAgentRecordDeleted(TWGManagedObject mo, long obj_id)
mo
- - managed object targetedobj_id
- - object ID for record (MO-ID or Group ID)public void registerChangeListener(TWGDistConfigRecordChangeListener list)
list
- - listenerpublic void deregisterChangeListener(TWGDistConfigRecordChangeListener list)
list
- - listener
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |