Class DfClientRegistry

All Implemented Interfaces:
IDfClientRegistry, IDfClientRegistryInternal

public class DfClientRegistry extends DfClientRegistryBaseInternal
  • Field Details

  • Constructor Details

    • DfClientRegistry

      public DfClientRegistry() throws DfException
      This constructor determines the correct type of registry to use. This constructor is protected since the default instance of the client registry is singleton.
      Throws:
      DfException - if the construction of the registry object failed
    • DfClientRegistry

      public DfClientRegistry(IDfRegistry registry)
      Constructs an instance of the client registry with the given registry object
      Parameters:
      registry - the registry object to be used by the client registry
  • Method Details

    • getRegistry

      public IDfRegistry getRegistry()
      Description copied from interface: IDfClientRegistry
      Returns the underlying internal registry object. There are separate registry objects for accessing the low level storage models of the Windows system registry or a .ini file.

      Note: This method is intended for internal use only.

      Returns:
      the underlying registry object
    • getRegistry

      public IDfRegistry getRegistry(long whichRoot)
      Description copied from interface: IDfClientRegistryInternal
      Returns IDfRegistry corresponding to the root. This method is useful if the underlying registry is windows registry. In windows, there are two different types of hives HKLM, HKCU. Currently, we store all the information in HKCU. However, there is some information like check out directory location, user directory location, program directory etc. that is present under HKLM. Hence, if you want to use HKLM hiive, the call method getRegistry() in the base interface. If, you want to use HKCU then use this method by passing IDfRegistry.USER_ROOT.
      Returns:
      IDfRegistry representation of registry.
    • addCheckedOutObject

      public IDfCheckedOutObject addCheckedOutObject(IDfSysObject sysObject, String filePath, boolean keepLocalFile, String folderPath) throws DfException
      Description copied from interface: IDfClientRegistry
      Constructs a DfCheckedOutObject and writes it to the registry
      Parameters:
      sysObject - the DfSysObject representing the file to be added
      filePath - the location of the checked-out file
      keepLocalFile - __REVISIT__
      folderPath - the folder path to the object in the repository
      Returns:
      the constructed DfCheckedOutObject
      Throws:
      DfException
    • addCheckedOutObject

      public void addCheckedOutObject(IDfCheckedOutObject cObj) throws DfException
      Description copied from interface: IDfClientRegistryInternal
      Adds the information contained in the checked out object to the registry.
      Parameters:
      cObj - IDfCheckedOutObject object representation of the checked out object.
      Throws:
      DfException
    • getCheckedOutObjects

      public IDfList getCheckedOutObjects() throws DfException
      Description copied from interface: IDfClientRegistry
      Gets all the checked out objects
      Returns:
      an enumerated list of DfCheckedOutObjects
      Throws:
      DfException
    • getCheckedOutObjectById

      public IDfCheckedOutObject getCheckedOutObjectById(IDfId objectId) throws DfException
      Description copied from interface: IDfClientRegistry
      Finds a checked-out file registry object based on object ID
      Parameters:
      objectId - DfId object with the id of the object to be found
      Returns:
      the DfCheckedOutObject with the given ID, or null if the ID does not exist
      Throws:
      DfException
    • getCheckedOutObjectByPath

      public IDfCheckedOutObject getCheckedOutObjectByPath(String filePath) throws DfException
      Description copied from interface: IDfClientRegistry
      Finds a checked-out file registry object based on file path
      Parameters:
      filePath - file path of the object to be found
      Returns:
      the DfCheckedOutObject with the file path
      Throws:
      DfException
    • removeCheckedOutObject

      public void removeCheckedOutObject(IDfCheckedOutObject itemToRemove) throws DfException
      Description copied from interface: IDfClientRegistry
      Removes a checked-out file object from the registry
      Parameters:
      itemToRemove - DfCheckedOutObject to remove
      Throws:
      DfException
    • getCheckedOutObjectsByMasterId

      public IDfEnumeration getCheckedOutObjectsByMasterId(String masterId)
    • addViewedObject

      public IDfViewedObject addViewedObject(IDfSysObject sysObject, String filePath, String folderPath) throws DfException
      Description copied from interface: IDfClientRegistry
      Constructs a DfViewedObject and writes it to the registry
      Parameters:
      sysObject - the DfSysObject representing the file to be added
      filePath - the location of the checked-out file
      folderPath - the folder path to the object in the repository
      Returns:
      the constructed DfViewedObject
      Throws:
      DfException
    • addViewedObject

      public void addViewedObject(IDfViewedObject viewedObj) throws DfException
      Description copied from interface: IDfClientRegistryInternal
      Adds the information contained in the viewed out object to the registry.
      Parameters:
      viewedObj - IDfViewedObject object representation of the viewed object.
      Throws:
      DfException
    • getViewedObjects

      public IDfList getViewedObjects() throws DfException
      Description copied from interface: IDfClientRegistry
      Gets all the viewed objects
      Returns:
      an enumerated list of DfCheckedOutObjects
      Throws:
      DfException
    • getViewedObjectById

      public IDfViewedObject getViewedObjectById(IDfId objectId) throws DfException
      Description copied from interface: IDfClientRegistry
      Finds a viewed file registry object based on object ID
      Parameters:
      objectId - DfId object with the ID of the object to be found
      Returns:
      the DfViewedObject with the given ID, or null if the ID does not exist
      Throws:
      DfException
    • getViewedObjectByPath

      public IDfViewedObject getViewedObjectByPath(String filePath) throws DfException
      Description copied from interface: IDfClientRegistry
      Finds a viewed file registry object based on file path
      Parameters:
      filePath - DfId object with the ID of the object to be found
      Returns:
      the DfViewedObject with the given ID, or null if the ID does not exist
      Throws:
      DfException
    • removeViewedObject

      public void removeViewedObject(IDfViewedObject itemToRemove) throws DfException
      Description copied from interface: IDfClientRegistry
      Removes a viewed object from the registry
      Parameters:
      itemToRemove - the viewed object to be removed from the registry
      Throws:
      DfException
    • addLocalObject

      public IDfLocalObject addLocalObject(IDfSysObject sysObject, String filePath, boolean keepLocalFile, String folderPath) throws DfException
      Description copied from interface: IDfClientRegistry
      Constructs a DfLocalObject and writes it to the registry
      Returns:
      the constructed DfLocalObject
      Throws:
      DfException
    • addLocalObject

      public void addLocalObject(IDfLocalObject regObj) throws DfException
      Description copied from interface: IDfClientRegistryInternal
      Adds the information contained in the local object to the registry.
      Parameters:
      regObj - IDfLocalObject object representation of the local object.
      Throws:
      DfException
    • getLocalObjects

      public IDfList getLocalObjects() throws DfException
      Description copied from interface: IDfClientRegistry
      Gets all the checked out objects
      Returns:
      an enumerated list of DfLocalObjects
      Throws:
      DfException
    • getLocalObjectById

      public IDfLocalObject getLocalObjectById(IDfId objectId) throws DfException
      Description copied from interface: IDfClientRegistry
      Finds a local file registry object based on object ID
      Returns:
      the DfLocalObject with the given ID, or null if the ID does not exist
      Throws:
      DfException
    • getLocalObjectByPath

      public IDfLocalObject getLocalObjectByPath(String filePath) throws DfException
      Description copied from interface: IDfClientRegistry
      Finds a local file registry object based on object ID
      Returns:
      the DfLocalObject with the given ID, or null if the ID does not exist
      Throws:
      DfException
    • removeLocalObject

      public void removeLocalObject(IDfLocalObject itemToRemove) throws DfException
      Description copied from interface: IDfClientRegistry
      Removes a local object from the registry
      Parameters:
      itemToRemove - the viewed object to be removed from the registry
      Throws:
      DfException
    • getHouseKeepingObject

      public IDfHouseKeepingObject getHouseKeepingObject()
      Description copied from interface: IDfClientRegistryInternal
      Returns the IDfHouseKeepingObject representation of the house keeping information contained in the registry.
      Returns:
      IDfHouseKeeping object
    • setProgramDirectory

      public void setProgramDirectory(String progDir) throws DfException
      Throws:
      DfException
    • getProgramDirectory

      public String getProgramDirectory() throws DfException
      Returns:
      program directory
      Throws:
      DfException
    • setUserDirectory

      public void setUserDirectory(String userDir) throws DfException
      Description copied from interface: IDfClientRegistry
      Sets in the registry the user's directory
      Throws:
      DfException
    • getUserDirectory

      public String getUserDirectory() throws DfException
      Returns:
      user directory
      Throws:
      DfException
    • setCheckoutDirectory

      public void setCheckoutDirectory(String checkoutDir) throws DfException
      Description copied from interface: IDfClientRegistry
      Sets in the registry the directory where checked out files will be placed
      Parameters:
      checkoutDir - the checkout directory path
      Throws:
      DfException
    • getCheckoutDirectory

      public String getCheckoutDirectory() throws DfException
      Returns:
      the directory path checked out files will be written to
      Throws:
      DfException
    • setExportDirectory

      public void setExportDirectory(String exportDir) throws DfException
      Description copied from interface: IDfClientRegistry
      Sets in the registry the directory exported files will be written to
      Parameters:
      exportDir - the directory to place exported files in
      Throws:
      DfException
    • getExportDirectory

      public String getExportDirectory() throws DfException
      Returns:
      the directory path exported files will be written to
      Throws:
      DfException
    • addFileToBeDeleted

      public void addFileToBeDeleted(String filePath) throws DfException
      Description copied from interface: IDfClientRegistry
      Adds a file to the "to be deleted" list in the registry
      Parameters:
      filePath - path of file to be deleted
      Throws:
      DfException
    • getFilesToBeDeleted

      public IDfList getFilesToBeDeleted() throws DfException
      Description copied from interface: IDfClientRegistry
      Gets the list of files to be deleted
      Returns:
      a DfList with the file paths of the files to be deleted
      Throws:
      DfException
    • removeFileToBeDeleted

      public void removeFileToBeDeleted(String filePath) throws DfException
      Description copied from interface: IDfClientRegistry
      Removes a file from the list of files to be deleted
      Parameters:
      filePath - path of file to be removed from list
      Throws:
      DfException
    • moveToLocalFiles

      public void moveToLocalFiles(IDfCheckedOutObject checkedOutObj, IDfSession session) throws DfException
      Description copied from interface: IDfClientRegistry
      Removes a checked out file and places it in the list of local files.

      Warning: Some fields are not shared by local files and checked-out files, so moving a checked-out file to local files and back again will NOT result in the same checked-out object as before.

      Parameters:
      checkedOutObj - the checked-out object to be moved
      session - the current session object
      Throws:
      DfException
    • moveToCheckedOutFiles

      public void moveToCheckedOutFiles(IDfLocalObject localObj) throws DfException
      Description copied from interface: IDfClientRegistry
      Removes a local file and places it in the list of checked-out files.

      Warning: Some fields are not shared by local files and checked-out files, so moving a local file to checked-out files and back again will NOT result in the same local object as before.

      Parameters:
      localObj - the local object to be moved
      Throws:
      DfException
    • applyModifiedAttrs

      public void applyModifiedAttrs(IDfSysObject sysObject) throws DfException
      Description copied from interface: IDfClientRegistry
      updates a checked-out object's attributes with those from a sysobject
      Parameters:
      sysObject - the sysobject to update the registry object with
      Throws:
      DfException
    • addInlineDescendant

      public void addInlineDescendant(IDfInlineDescendantInternal inlineObj) throws DfException
      Description copied from interface: IDfClientRegistryInternal
      Writes the information contained in IDfInlineDescendantInternal object to the registry
      Parameters:
      inlineObj - IDfInlineDescendantInternal object that contains inline descendant information.
      Throws:
      DfException
    • removeInlineDescendant

      public void removeInlineDescendant(IDfId objId) throws DfException
      Description copied from interface: IDfClientRegistryInternal
      Removes the inline descendant information corresponding to the object id from the registry.
      Parameters:
      objId - the inline descendant correponding to this object id will be removed from the registry.
      Throws:
      DfException
    • getInlineDescendant

      public IDfInlineDescendantInternal getInlineDescendant(IDfId objId) throws DfException
      Description copied from interface: IDfClientRegistryInternal
      Get IDfInlineDescendantInternal object representation of the inline descendant corresponding to the object id.
      Parameters:
      objId - the inline descendant object id
      Returns:
      IDfInlineDescendantInternal object
      Throws:
      DfException
    • addAppSupportDocument

      public void addAppSupportDocument(IDfAppSupportDocumentInternal appSupportDoc) throws DfException
      Description copied from interface: IDfClientRegistryInternal
      Writes the information contained in IDfAppSupportDocumentInternal object to the registry
      Parameters:
      appSupportDoc - IDfAppSupportDocumentInternal object that contains application support document information.
      Throws:
      DfException
    • removeAppSupportDocument

      public void removeAppSupportDocument(String docbase, String userName, String applicationName, IDfId objectId) throws DfException
      Description copied from interface: IDfClientRegistryInternal
      Removes the application support document information from the registry. Docbase Name, docbase user, application name and object id together uniquely define the application support document information in the registry.
      Parameters:
      docbase - the docbase name
      userName - the docbase user name
      applicationName - the XML application name
      objectId - the docbase object id
      Throws:
      DfException
    • getApplicationSupportDocuments

      public IDfList getApplicationSupportDocuments() throws DfException
      Description copied from interface: IDfClientRegistryInternal
      Returns a list of IDfApplicationSupportDocument objects.
      Returns:
      IDfList of IDfApplicationSupportDocument objects.
      Throws:
      DfException
    • getAppSupportDocument

      public IDfAppSupportDocumentInternal getAppSupportDocument(String docbase, String docbaseUser, String appName, IDfId objectId) throws DfException
      Description copied from interface: IDfClientRegistryInternal
      Get IDfAppSupportDocumentInternal object representation of the application support document information in the registry. Docbase Name, docbase user, application name and object id together uniquely define the application support document information in the registry.
      Parameters:
      docbase - docbase name
      docbaseUser - docbase user name
      appName - application name
      objectId - docbase object id
      Returns:
      IDfAppSupportDocumentInternal object representation of the application support document information in the registry
      Throws:
      DfException
    • loadRegistry

      public void loadRegistry() throws DfException
      Description copied from interface: IDfClientRegistryInternal
      Loads the information contained in the underlying registry storage in memory.
      Throws:
      DfException
    • saveRegistryUpdates

      public void saveRegistryUpdates() throws DfException
      Description copied from interface: IDfClientRegistryInternal
      Saves the information contained in the memory to the underlying registry.
      Throws:
      DfException
    • isLocalItemProcessingRequired

      public boolean isLocalItemProcessingRequired()
      Description copied from interface: IDfClientRegistryInternal
      Returns true if the local item processing is required. This is false for the ini file representation of the registry.
      Returns:
      true if local item processing is required; false otherwise
    • createCheckedOutObject

      public IDfCheckedOutObject createCheckedOutObject(IDfId objId) throws DfException
      Description copied from interface: IDfClientRegistryInternal
      Creates a IDfCheckedOutObject representation of the checked out object. Note that there is no information contained in this object when it is created. It is just an empty place holder in which the information about checked out object can be populated.
      Returns:
      IDfCheckedOutObject
      Throws:
      DfException
    • createViewedObject

      public IDfViewedObject createViewedObject(IDfId objId) throws DfException
      Description copied from interface: IDfClientRegistryInternal
      Creates a IDfViewedObject representation of the viewed object. Note that there is no information contained in this object when it is created. It is just an empty place holder in which the information about viewed object can be populated.
      Returns:
      IDfViewedObject
      Throws:
      DfException
    • createLocalObject

      public IDfLocalObject createLocalObject(IDfId objId) throws DfException
      Description copied from interface: IDfClientRegistryInternal
      Creates a IDfLocalObject representation of the local object. Note that there is no information contained in this object when it is created. It is just an empty place holder in which the information about local object can be populated.
      Returns:
      IDfLocalObject
      Throws:
      DfException
    • createAppSupportDocument

      public IDfAppSupportDocumentInternal createAppSupportDocument(String docbase, String docbaseUser, String appName, IDfId objectId) throws DfException
      Description copied from interface: IDfClientRegistryInternal
      Creates a IDfAppSupportDocumentInternal representation of the application support document. Note that the only information contained in this IDfApplicationSupportDocument after creation is what is passed as parameter values i.e. docbase name, docbase user, application name and object id. Other related information for this application support document should be populated.
      Parameters:
      docbase - docbase name
      docbaseUser - docbase user
      appName - application name
      objectId - docbase object id
      Returns:
      IDfApplicationSupportDocument
      Throws:
      DfException
    • createInlineDescendantObject

      public IDfInlineDescendantInternal createInlineDescendantObject(IDfId objectId, IDfId rootId) throws DfException
      Description copied from interface: IDfClientRegistryInternal
      Creates an IDfInlineDescendantInternal object representation of the inline descendant information contained in the registry.
      Parameters:
      objectId - docbase object id that corresponds to the inline descendant
      rootId - docbase object id that contains this inline descendant (directly or indeirectly)
      Returns:
      IDfInlineDescendantInternal object
      Throws:
      DfException