Class FilesAndFoldersClient

    • Constructor Summary

      Constructors 
      Constructor Description
      FilesAndFoldersClient​(java.lang.String serverName, java.lang.String serverPlatformURLRoot)
      Create a new client with no authentication embedded in the HTTP request.
      FilesAndFoldersClient​(java.lang.String serverName, java.lang.String serverPlatformURLRoot, java.lang.String userId, java.lang.String password)
      Create a new client that passes userId and password in each HTTP request.
      FilesAndFoldersClient​(java.lang.String serverName, java.lang.String serverPlatformURLRoot, java.lang.String userId, java.lang.String password, AuditLog auditLog)
      Create a new client that passes userId and password in each HTTP request.
      FilesAndFoldersClient​(java.lang.String serverName, java.lang.String serverPlatformURLRoot, DataManagerRESTClient restClient, int maxPageSize, AuditLog auditLog)
      Create a new client that is to be used within an OMAG Server.
      FilesAndFoldersClient​(java.lang.String serverName, java.lang.String serverPlatformURLRoot, AuditLog auditLog)
      Create a new client with no authentication embedded in the HTTP request.
    • Constructor Detail

      • FilesAndFoldersClient

        public FilesAndFoldersClient​(java.lang.String serverName,
                                     java.lang.String serverPlatformURLRoot,
                                     AuditLog auditLog)
                              throws InvalidParameterException
        Create a new client with no authentication embedded in the HTTP request.
        Parameters:
        serverName - name of the server to connect to
        serverPlatformURLRoot - the network address of the server running the OMAS REST servers
        auditLog - logging destination
        Throws:
        InvalidParameterException - there is a problem creating the client-side components to issue any REST API calls.
      • FilesAndFoldersClient

        public FilesAndFoldersClient​(java.lang.String serverName,
                                     java.lang.String serverPlatformURLRoot)
                              throws InvalidParameterException
        Create a new client with no authentication embedded in the HTTP request.
        Parameters:
        serverName - name of the server to connect to
        serverPlatformURLRoot - the network address of the server running the OMAS REST servers
        Throws:
        InvalidParameterException - there is a problem creating the client-side components to issue any REST API calls.
      • FilesAndFoldersClient

        public FilesAndFoldersClient​(java.lang.String serverName,
                                     java.lang.String serverPlatformURLRoot,
                                     java.lang.String userId,
                                     java.lang.String password,
                                     AuditLog auditLog)
                              throws InvalidParameterException
        Create a new client that passes userId and password in each HTTP request. This is the userId/password of the calling server. The end user's userId is sent on each request.
        Parameters:
        serverName - name of the server to connect to
        serverPlatformURLRoot - the network address of the server running the OMAS REST servers
        userId - caller's userId embedded in all HTTP requests
        password - caller's userId embedded in all HTTP requests
        auditLog - logging destination
        Throws:
        InvalidParameterException - there is a problem creating the client-side components to issue any REST API calls.
      • FilesAndFoldersClient

        public FilesAndFoldersClient​(java.lang.String serverName,
                                     java.lang.String serverPlatformURLRoot,
                                     java.lang.String userId,
                                     java.lang.String password)
                              throws InvalidParameterException
        Create a new client that passes userId and password in each HTTP request. This is the userId/password of the calling server. The end user's userId is sent on each request.
        Parameters:
        serverName - name of the server to connect to
        serverPlatformURLRoot - the network address of the server running the OMAS REST servers
        userId - caller's userId embedded in all HTTP requests
        password - caller's userId embedded in all HTTP requests
        Throws:
        InvalidParameterException - there is a problem creating the client-side components to issue any REST API calls.
      • FilesAndFoldersClient

        public FilesAndFoldersClient​(java.lang.String serverName,
                                     java.lang.String serverPlatformURLRoot,
                                     DataManagerRESTClient restClient,
                                     int maxPageSize,
                                     AuditLog auditLog)
                              throws InvalidParameterException
        Create a new client that is to be used within an OMAG Server.
        Parameters:
        serverName - name of the server to connect to
        serverPlatformURLRoot - the network address of the server running the OMAS REST servers
        restClient - pre-initialized REST client
        maxPageSize - pre-initialized parameter limit
        auditLog - logging destination
        Throws:
        InvalidParameterException - there is a problem with the information about the remote OMAS
    • Method Detail

      • createNestedFolders

        public java.util.List<java.lang.String> createNestedFolders​(java.lang.String userId,
                                                                    java.lang.String fileManagerCapabilityGUID,
                                                                    java.lang.String fileManagerCapabilityName,
                                                                    java.lang.String parentGUID,
                                                                    java.lang.String pathName)
                                                             throws InvalidParameterException,
                                                                    UserNotAuthorizedException,
                                                                    PropertyServerException
        Creates a new folder asset for each element in the pathName. For example, a pathName of "one/two/three" creates 3 new folder assets, one called "one", the next called "one/two" and the last one called "one/two/three".
        Specified by:
        createNestedFolders in interface FilesAndFoldersInterface
        Parameters:
        userId - calling user
        fileManagerCapabilityGUID - unique identifier of the software server capability representing an owning external file manager or null
        fileManagerCapabilityName - unique name of the software server capability representing an owning external file manager or null
        parentGUID - unique identifier of root object to connect the folder to (fileSystemGUID or folderGUID)
        pathName - pathname of the folder (or folders)
        Returns:
        list of GUIDs from the top level to the leaf of the supplied pathname
        Throws:
        InvalidParameterException - one of the parameters is null or invalid
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • attachTopLevelFolder

        public void attachTopLevelFolder​(java.lang.String userId,
                                         java.lang.String fileManagerCapabilityGUID,
                                         java.lang.String fileManagerCapabilityName,
                                         java.lang.String fileSystemGUID,
                                         java.lang.String folderGUID)
                                  throws InvalidParameterException,
                                         UserNotAuthorizedException,
                                         PropertyServerException
        Links a folder to a file system. The folder is not changed.
        Specified by:
        attachTopLevelFolder in interface FilesAndFoldersInterface
        Parameters:
        userId - calling user
        fileManagerCapabilityGUID - unique identifier of the software server capability representing an owning external file manager or null
        fileManagerCapabilityName - unique name of the software server capability representing an owning external file manager or null
        fileSystemGUID - unique identifier of the file system
        folderGUID - unique identifier of the folder in the catalog
        Throws:
        InvalidParameterException - one of the parameters is null or invalid
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • detachTopLevelFolder

        public void detachTopLevelFolder​(java.lang.String userId,
                                         java.lang.String fileManagerCapabilityGUID,
                                         java.lang.String fileManagerCapabilityName,
                                         java.lang.String fileSystemGUID,
                                         java.lang.String folderGUID)
                                  throws InvalidParameterException,
                                         UserNotAuthorizedException,
                                         PropertyServerException
        Removed the link between a folder and a file system.
        Specified by:
        detachTopLevelFolder in interface FilesAndFoldersInterface
        Parameters:
        userId - calling user
        fileManagerCapabilityGUID - unique identifier of the software server capability representing an owning external file manager or null
        fileManagerCapabilityName - unique name of the software server capability representing an owning external file manager or null
        fileSystemGUID - unique identifier of the file system
        folderGUID - unique identifier of the folder in the catalog
        Throws:
        InvalidParameterException - one of the parameters is null or invalid
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • addDataFileToCatalog

        public java.util.List<java.lang.String> addDataFileToCatalog​(java.lang.String userId,
                                                                     java.lang.String fileManagerCapabilityGUID,
                                                                     java.lang.String fileManagerCapabilityName,
                                                                     DataFileProperties dataFileProperties,
                                                                     java.lang.String connectorProviderName)
                                                              throws InvalidParameterException,
                                                                     UserNotAuthorizedException,
                                                                     PropertyServerException
        Creates a new file asset and links it to the folder structure implied in the path name. If the folder structure is not catalogued already, this is created automatically using the createFolderStructureInCatalog() method. For example, a pathName of "one/two/three/MyFile.txt" potentially creates 3 new folder assets, one called "one", the next called "one/two" and the last one called "one/two/three" plus a file asset called "one/two/three/MyFile.txt".
        Specified by:
        addDataFileToCatalog in interface FilesAndFoldersInterface
        Parameters:
        userId - calling user
        fileManagerCapabilityGUID - unique identifier of the software server capability representing an owning external file manager or null
        fileManagerCapabilityName - unique name of the software server capability representing an owning external file manager or null
        dataFileProperties - details of the data file to add to the catalog as an asset
        connectorProviderName - class name of connector provider for connector to access this asset
        Returns:
        list of GUIDs from the top level to the root of the pathname
        Throws:
        InvalidParameterException - one of the parameters is null or invalid
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • addDataFileToCatalogFromTemplate

        public java.util.List<java.lang.String> addDataFileToCatalogFromTemplate​(java.lang.String userId,
                                                                                 java.lang.String fileManagerCapabilityGUID,
                                                                                 java.lang.String fileManagerCapabilityName,
                                                                                 java.lang.String templateGUID,
                                                                                 TemplateProperties templateProperties)
                                                                          throws InvalidParameterException,
                                                                                 UserNotAuthorizedException,
                                                                                 PropertyServerException
        Add an asset description a file based on the content of a template object. Link this new asset to the folder structure implied in the path name. If the folder structure is not catalogued already, this is created automatically using the createFolderStructureInCatalog() method. For example, a pathName of "one/two/three/MyFile.txt" potentially creates 3 new folder assets, one called "one", the next called "one/two" and the last one called "one/two/three" plus a file asset called "one/two/three/MyFile.txt".
        Specified by:
        addDataFileToCatalogFromTemplate in interface FilesAndFoldersInterface
        Parameters:
        userId - calling user
        fileManagerCapabilityGUID - unique identifier of the software server capability representing an owning external file manager or null
        fileManagerCapabilityName - unique name of the software server capability representing an owning external file manager or null
        templateGUID - unique identifier of the file asset to copy
        templateProperties - override properties for the asset
        Returns:
        list of GUIDs from the top level to the root of the pathname
        Throws:
        InvalidParameterException - one of the parameters is null or invalid
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • updateDataFileInCatalog

        public void updateDataFileInCatalog​(java.lang.String userId,
                                            java.lang.String fileManagerCapabilityGUID,
                                            java.lang.String fileManagerCapabilityName,
                                            java.lang.String dataFileGUID,
                                            boolean isMergeUpdate,
                                            DataFileProperties dataFileProperties)
                                     throws InvalidParameterException,
                                            UserNotAuthorizedException,
                                            PropertyServerException
        Update the file asset description in the catalog.
        Specified by:
        updateDataFileInCatalog in interface FilesAndFoldersInterface
        Parameters:
        userId - calling user (assumed to be the owner)
        fileManagerCapabilityGUID - unique identifier of the software server capability representing an owning external file manager or null
        fileManagerCapabilityName - unique name of the software server capability representing an owning external file manager or null
        dataFileGUID - unique identifier of the data file asset
        isMergeUpdate - should the supplied properties completely override the existing properties or augment them?
        dataFileProperties - properties for the asset
        Throws:
        InvalidParameterException - one of the parameters is null or invalid
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • archiveDataFileInCatalog

        public void archiveDataFileInCatalog​(java.lang.String userId,
                                             java.lang.String fileManagerCapabilityGUID,
                                             java.lang.String fileManagerCapabilityName,
                                             java.lang.String dataFileGUID,
                                             ArchiveProperties archiveProperties)
                                      throws InvalidParameterException,
                                             UserNotAuthorizedException,
                                             PropertyServerException
        Mark the file asset description in the catalog as archived.
        Specified by:
        archiveDataFileInCatalog in interface FilesAndFoldersInterface
        Parameters:
        userId - calling user (assumed to be the owner)
        fileManagerCapabilityGUID - unique identifier of the software server capability representing an owning external file manager or null
        fileManagerCapabilityName - unique name of the software server capability representing an owning external file manager or null
        dataFileGUID - unique identifier of the data file asset
        archiveProperties - properties to help locate the archive copy
        Throws:
        InvalidParameterException - one of the parameters is null or invalid
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • deleteDataFileFromCatalog

        public void deleteDataFileFromCatalog​(java.lang.String userId,
                                              java.lang.String fileManagerCapabilityGUID,
                                              java.lang.String fileManagerCapabilityName,
                                              java.lang.String dataFileGUID,
                                              java.lang.String fullPathname)
                                       throws InvalidParameterException,
                                              UserNotAuthorizedException,
                                              PropertyServerException
        Remove the file asset description from the catalog.
        Specified by:
        deleteDataFileFromCatalog in interface FilesAndFoldersInterface
        Parameters:
        userId - calling user (assumed to be the owner)
        fileManagerCapabilityGUID - unique identifier of the software server capability representing an owning external file manager or null
        fileManagerCapabilityName - unique name of the software server capability representing an owning external file manager or null
        dataFileGUID - unique identifier of the data file asset
        fullPathname - unique path and file name for file
        Throws:
        InvalidParameterException - one of the parameters is null or invalid
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • addDataFolderToCatalog

        public java.util.List<java.lang.String> addDataFolderToCatalog​(java.lang.String userId,
                                                                       java.lang.String fileManagerCapabilityGUID,
                                                                       java.lang.String fileManagerCapabilityName,
                                                                       FileFolderProperties fileFolderProperties,
                                                                       java.lang.String connectorProviderName)
                                                                throws InvalidParameterException,
                                                                       UserNotAuthorizedException,
                                                                       PropertyServerException
        Creates a new folder asset that is identified as a data asset. This means the files and sub-folders within it collectively make up the contents of the data asset. As with other types of file-based asset, links are made to the folder structure implied in the path name. If the folder structure is not catalogued already, this is created automatically using the createFolderStructureInCatalog() method. For example, a pathName of "one/two/three/MyDataFolder" potentially creates 3 new folder assets, one called "one", the next called "one/two" and the last one called "one/two/three" plus a DataFolder asset called "one/two/three/MyDataFolder".
        Specified by:
        addDataFolderToCatalog in interface FilesAndFoldersInterface
        Parameters:
        userId - calling user
        fileManagerCapabilityGUID - unique identifier of the software server capability representing an owning external file manager or null
        fileManagerCapabilityName - unique name of the software server capability representing an owning external file manager or null
        fileFolderProperties - properties to describe the folder properties
        connectorProviderName - class name of connector provider for connector to access this asset
        Returns:
        list of GUIDs from the top level to the root of the pathname
        Throws:
        InvalidParameterException - one of the parameters is null or invalid
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • addDataFolderToCatalogFromTemplate

        public java.util.List<java.lang.String> addDataFolderToCatalogFromTemplate​(java.lang.String userId,
                                                                                   java.lang.String fileManagerCapabilityGUID,
                                                                                   java.lang.String fileManagerCapabilityName,
                                                                                   java.lang.String templateGUID,
                                                                                   TemplateProperties templateProperties)
                                                                            throws InvalidParameterException,
                                                                                   UserNotAuthorizedException,
                                                                                   PropertyServerException
        Add an asset description a file based on the content of a template object. Link this new asset to the folder structure implied in the path name. If the folder structure is not catalogued already, this is created automatically using the createFolderStructureInCatalog() method. For example, a pathName of "one/two/three/MyFile.txt" potentially creates 3 new folder assets, one called "one", the next called "one/two" and the last one called "one/two/three" plus a file asset called "one/two/three/MyFile.txt".
        Specified by:
        addDataFolderToCatalogFromTemplate in interface FilesAndFoldersInterface
        Parameters:
        userId - calling user
        fileManagerCapabilityGUID - unique identifier of the software server capability representing an owning external file manager or null
        fileManagerCapabilityName - unique name of the software server capability representing an owning external file manager or null
        templateGUID - unique identifier of the file asset to copy
        templateProperties - override properties for the asset
        Returns:
        list of GUIDs from the top level to the root of the pathname
        Throws:
        InvalidParameterException - one of the parameters is null or invalid
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • updateDataFolderInCatalog

        public void updateDataFolderInCatalog​(java.lang.String userId,
                                              java.lang.String fileManagerCapabilityGUID,
                                              java.lang.String fileManagerCapabilityName,
                                              java.lang.String dataFolderGUID,
                                              boolean isMergeUpdate,
                                              FileFolderProperties fileFolderProperties)
                                       throws InvalidParameterException,
                                              UserNotAuthorizedException,
                                              PropertyServerException
        Update the data folder asset description in the catalog.
        Specified by:
        updateDataFolderInCatalog in interface FilesAndFoldersInterface
        Parameters:
        userId - calling user (assumed to be the owner)
        fileManagerCapabilityGUID - unique identifier of the software server capability representing an owning external file manager or null
        fileManagerCapabilityName - unique name of the software server capability representing an owning external file manager or null
        dataFolderGUID - unique identifier of the data folder asset
        isMergeUpdate - should the supplied properties completely override the existing properties or augment them?
        fileFolderProperties - properties for the asset
        Throws:
        InvalidParameterException - one of the parameters is null or invalid
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • archiveDataFolderInCatalog

        public void archiveDataFolderInCatalog​(java.lang.String userId,
                                               java.lang.String fileManagerCapabilityGUID,
                                               java.lang.String fileManagerCapabilityName,
                                               java.lang.String dataFolderGUID,
                                               ArchiveProperties archiveProperties)
                                        throws InvalidParameterException,
                                               UserNotAuthorizedException,
                                               PropertyServerException
        Mark the data folder asset description in the catalog as archived.
        Specified by:
        archiveDataFolderInCatalog in interface FilesAndFoldersInterface
        Parameters:
        userId - calling user (assumed to be the owner)
        fileManagerCapabilityGUID - unique identifier of the software server capability representing an owning external file manager or null
        fileManagerCapabilityName - unique name of the software server capability representing an owning external file manager or null
        dataFolderGUID - unique identifier of the data folder asset
        archiveProperties - properties to help locate the archive copy
        Throws:
        InvalidParameterException - one of the parameters is null or invalid
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • deleteDataFolderFromCatalog

        public void deleteDataFolderFromCatalog​(java.lang.String userId,
                                                java.lang.String fileManagerCapabilityGUID,
                                                java.lang.String fileManagerCapabilityName,
                                                java.lang.String dataFolderGUID,
                                                java.lang.String fullPathname)
                                         throws InvalidParameterException,
                                                UserNotAuthorizedException,
                                                PropertyServerException
        Remove the data folder asset description from the catalog.
        Specified by:
        deleteDataFolderFromCatalog in interface FilesAndFoldersInterface
        Parameters:
        userId - calling user (assumed to be the owner)
        fileManagerCapabilityGUID - unique identifier of the software server capability representing an owning external file manager or null
        fileManagerCapabilityName - unique name of the software server capability representing an owning external file manager or null
        dataFolderGUID - unique identifier of the data folder asset
        fullPathname - unique path and file name for file
        Throws:
        InvalidParameterException - one of the parameters is null or invalid
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • attachDataFileAssetToFolder

        public void attachDataFileAssetToFolder​(java.lang.String userId,
                                                java.lang.String fileManagerCapabilityGUID,
                                                java.lang.String fileManagerCapabilityName,
                                                java.lang.String folderGUID,
                                                java.lang.String fileGUID)
                                         throws InvalidParameterException,
                                                UserNotAuthorizedException,
                                                PropertyServerException
        Link an existing file asset to a folder. The file is not changed as this is used to create a logical link to the folder.
        Specified by:
        attachDataFileAssetToFolder in interface FilesAndFoldersInterface
        Parameters:
        userId - calling user
        fileManagerCapabilityGUID - unique identifier of the software server capability representing an owning external file manager or null
        fileManagerCapabilityName - unique name of the software server capability representing an owning external file manager or null
        folderGUID - unique identifier of the folder
        fileGUID - unique identifier of the file
        Throws:
        InvalidParameterException - one of the parameters is null or invalid
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • detachDataFileAssetFromFolder

        public void detachDataFileAssetFromFolder​(java.lang.String userId,
                                                  java.lang.String fileManagerCapabilityGUID,
                                                  java.lang.String fileManagerCapabilityName,
                                                  java.lang.String folderGUID,
                                                  java.lang.String fileGUID)
                                           throws InvalidParameterException,
                                                  UserNotAuthorizedException,
                                                  PropertyServerException
        Remove a link between a file asset and a folder. The file is not changed. Use moveDataFileInCatalog to record the fact that the physical file has moved. Use attachDataFileAssetToFolder to create logical link to a new folder.
        Specified by:
        detachDataFileAssetFromFolder in interface FilesAndFoldersInterface
        Parameters:
        userId - calling user
        fileManagerCapabilityGUID - unique identifier of the software server capability representing an owning external file manager or null
        fileManagerCapabilityName - unique name of the software server capability representing an owning external file manager or null
        folderGUID - unique identifier of the folder
        fileGUID - unique identifier of the file
        Throws:
        InvalidParameterException - one of the parameters is null or invalid
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • moveDataFileInCatalog

        public void moveDataFileInCatalog​(java.lang.String userId,
                                          java.lang.String fileManagerCapabilityGUID,
                                          java.lang.String fileManagerCapabilityName,
                                          java.lang.String folderGUID,
                                          java.lang.String fileGUID)
                                   throws InvalidParameterException,
                                          UserNotAuthorizedException,
                                          PropertyServerException
        Move a data file from its current parent folder to a new parent folder - this changes the file's qualified name but not its unique identifier (guid). Similarly to the endpoint in the connection object.
        Specified by:
        moveDataFileInCatalog in interface FilesAndFoldersInterface
        Parameters:
        userId - calling user
        fileManagerCapabilityGUID - unique identifier of the software server capability representing an owning external file manager or null
        fileManagerCapabilityName - unique name of the software server capability representing an owning external file manager or null
        folderGUID - unique identifier of the folder
        fileGUID - unique identifier of the file
        Throws:
        InvalidParameterException - one of the parameters is null or invalid
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • moveDataFolderInCatalog

        public void moveDataFolderInCatalog​(java.lang.String userId,
                                            java.lang.String fileManagerCapabilityGUID,
                                            java.lang.String fileManagerCapabilityName,
                                            java.lang.String folderGUID,
                                            java.lang.String dataFolderGUID)
                                     throws InvalidParameterException,
                                            UserNotAuthorizedException,
                                            PropertyServerException
        Move a data folder from its current parent folder to a new parent folder - this changes the folder's qualified name but not its unique identifier (guid). Similarly to the endpoint in the connection object.
        Specified by:
        moveDataFolderInCatalog in interface FilesAndFoldersInterface
        Parameters:
        userId - calling user
        fileManagerCapabilityGUID - unique identifier of the software server capability representing an owning external file manager or null
        fileManagerCapabilityName - unique name of the software server capability representing an owning external file manager or null
        folderGUID - unique identifier of the folder
        dataFolderGUID - unique identifier of the data folder to move
        Throws:
        InvalidParameterException - one of the parameters is null or invalid
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem