Interface MetadataStore


  • public interface MetadataStore
    The MetadataStore class represents the highest level metadata container. The metadata store contains build groups. This class contains helper methods for creating, copying, retrieving, and deleting build groups.

    To access, create, or modify lower-level metadata objects, such as Collection, BuildResult, or BuildMap objects, first create or get a BuildGroup using this class. Then use the BuildGroup to access or create the lower level metadata objects that it contains. See the BuildGroup class for more information.

    • Method Detail

      • getType

        MetadataStore.Type getType()
        Returns the type associated with this instance. The type indicates whether the instance is a Filesystem or Db2 MetadataStore.
        Returns:
        the MetadataStore.Type of this instance, either Type.FILE or Type.DB2.
      • getLocation

        java.lang.String getLocation()
        Returns the location associated with this instance. For a Db2 MetadataStore, the URL to the database will be returned. For a Filesystem MetadataStore, the path to the file location will be returned.
        Returns:
        the location of the MetadataStore instance.
      • getImpactedFiles

        java.util.List<Collection> getImpactedFiles​(java.util.List<java.lang.String> collections,
                                                    java.util.List<LogicalDependency> lds)
                                             throws BuildException
        Get a list of impacted files in a list of collections with dependencies on a list of logical dependencies.
        Parameters:
        collections - List of collections to search
        lds - List of dependencies
        Returns:
        list of impacted collections with their impacted logical files. Note that collections returned from this method have no connection to the metadata store and may not be complete (ie may not contain a full list of logical files). To get a full list of logical files or to update the collection, a corresponding collection must be obtained from the metadata store {@link MetadataStore.getCollection(String)}.
        Throws:
        BuildException
      • createBuildGroup

        BuildGroup createBuildGroup​(java.lang.String group)
                             throws BuildException
        Creates a new build group
        Parameters:
        group - The new group name
        Returns:
        The new BuildGroup
        Throws:
        BuildException
      • copyBuildGroup

        BuildGroup copyBuildGroup​(java.lang.String source,
                                  java.lang.String newName,
                                  boolean collections,
                                  boolean buildResults,
                                  boolean buildMaps)
                           throws BuildException
        Creates a new build group, copying all collections, build results, and/or all build maps, as selected, to the new build group.
        Parameters:
        source - The source build group name
        newName - The new build group name
        collections - Pass true to copy all collections; false to skip
        buildResults - Pass true to copy all build results; false to skip
        buildMaps - Pass true to copy all build maps; false to skip
        Throws:
        BuildException
      • createTopicBuildGroup

        BuildGroup createTopicBuildGroup​(java.lang.String source,
                                         java.lang.String newName)
                                  throws BuildException
        Creates a new topic branch build group, copying all collections and the last successful build result to the new build group.
        Parameters:
        source - The source build group name
        newName - The new topic branch build group name
        Throws:
        BuildException
      • getBuildGroup

        BuildGroup getBuildGroup​(java.lang.String group)
                          throws BuildException
        Get a build group
        Parameters:
        group - the group name
        Returns:
        the BuildGroup, if it exists. Returns null if a build group with specified name does not exist
        Throws:
        BuildException
      • deleteBuildGroup

        void deleteBuildGroup​(java.lang.String group)
                       throws BuildException
        Delete an existing build group

        Deletes all collections, build results, and build maps within this build group

        Parameters:
        group - name of the build group to delete
        Throws:
        BuildException
      • deleteBuildGroup

        void deleteBuildGroup​(BuildGroup group)
                       throws BuildException
        Delete an existing build group

        Deletes all collections, build results, and build maps within this build group

        Parameters:
        group - the BuildGroup object to delete
        Throws:
        BuildException
      • buildGroupExists

        boolean buildGroupExists​(java.lang.String group)
                          throws BuildException
        Check wheter a build group exists
        Parameters:
        group - the name of the build group to check existance
        Returns:
        true if the build group exists, false otherwise
        Throws:
        BuildException
      • getBuildGroupNames

        java.util.List<java.lang.String> getBuildGroupNames()
                                                     throws BuildException
        Get a list of all build group names
        Returns:
        List the names of all build groups (as Strings)
        Throws:
        BuildException
      • createCollection

        @Deprecated
        Collection createCollection​(java.lang.String collectionName)
                             throws BuildException
        Deprecated.
        As of release 2.0.2, replaced by BuildGroup.createCollection(String)
        Create a legacy collection with the new name. Duplicate collections names are not allowed. Recommend using #collectionExits(String) to check for the existence before creating a new collection.
        Parameters:
        collectionName - The name of the new collection
        Returns:
        A new collection
        Throws:
        BuildException
      • createCollection

        @Deprecated
        Collection createCollection​(java.lang.String name,
                                    java.lang.String owner,
                                    java.lang.String team,
                                    int permission)
                             throws BuildException
        Deprecated.
        Create a legacy collection with the new name. Duplicate collections names are not allowed. It's better to use #collectionExits(String) to check for the existence before creating a new collection.
        Parameters:
        collectionName - The name of the new collection
        owner - the userid of the owner of this object.
        team - the team for this object.
        permission - The owner, team, and other permissions for this object.
        Returns:
        A new collection
        Throws:
        BuildException
      • collectionExists

        @Deprecated
        boolean collectionExists​(java.lang.String collectionName)
                          throws BuildException
        Deprecated.
        As of release 2.0.2, replaced by BuildGroup.collectionExists(String name)
        Check to see if a legacy collection by this name already exists
        Parameters:
        collectionName - The name of the collection
        Returns:
        true or false
        Throws:
        BuildException
      • deleteCollection

        @Deprecated
        void deleteCollection​(java.lang.String collectionName)
                       throws BuildException
        Deprecated.
        As of release 2.0.2, replaced by BuildGroup.deleteCollection(String)
        Delete a legacy collection by a specific name.
        Parameters:
        collectionName - Name of the collection to delete.
        Throws:
        BuildException
      • createBuildResult

        @Deprecated
        BuildResult createBuildResult​(java.lang.String group,
                                      java.lang.String label,
                                      java.lang.String owner,
                                      java.lang.String team,
                                      int permission)
                               throws BuildException
        Deprecated.
        Create a BuildResult in the metadata store
        Parameters:
        group - The group associated with the new build result
        label - The unique label within the group for the new build result.
        owner - the userid of the owner of this object.
        team - the team for this object.
        permission - The owner, team, and other permissions for this object.
        Returns:
        The new build result
        Throws:
        BuildException
      • createBuildResult

        @Deprecated
        BuildResult createBuildResult​(java.lang.String group,
                                      java.lang.String label)
                               throws BuildException
        Deprecated.
        As of release 2.0.2, replaced by BuildGroup.createBuildResult(String)
        Create a BuildResult in the metadata store
        Parameters:
        group - The group associated with the new build result
        label - The unique label within the group for the new build result.
        Returns:
        The new build result
        Throws:
        BuildException
      • buildResultExists

        @Deprecated
        boolean buildResultExists​(java.lang.String group,
                                  java.lang.String label)
                           throws BuildException
        Deprecated.
        As of release 2.0.2, replaced by BuildGroup.buildResultExists(String label)
        Check to see if a build result already exists
        Parameters:
        group - The build result group
        label - The label of the build result
        Returns:
        true or false
        Throws:
        BuildException
      • getLastBuildResult

        @Deprecated
        BuildResult getLastBuildResult​(java.lang.String group,
                                       int state,
                                       int status)
                                throws BuildException
        Deprecated.
        As of release 2.0.2, replaced by BuildGroup.getLastBuildResult(int, int)
        Get the latest build result within a group with the specified state and status. This is commonly used to find the last successful build.
        Parameters:
        group - The build group for the build result
        state - The state of the build result
        status - The status of the build result
        Returns:
        build result
        Throws:
        BuildException
      • getBuildResults

        @Deprecated
        java.util.List<BuildResult> getBuildResults​(java.lang.String group)
                                             throws BuildException
        Deprecated.
        As of release 2.0.2, replaced by BuildGroup.getBuildResults()
        Get a list of all of the build results in a build group.
        Parameters:
        group - The name of the build group
        Returns:
        list of build results in build group
        Throws:
        BuildException
      • getBuildResult

        @Deprecated
        BuildResult getBuildResult​(java.lang.String group,
                                   java.lang.String label)
                            throws BuildException
        Deprecated.
        As of release 2.0.2, replaced by BuildGroup.getBuildResult(String label)
        Get a specific build result within a group with the unique label.
        Parameters:
        group - The build group of the build result
        label - The label of the build result
        Returns:
        the build result or null, if the build result doesn't exist.
        Throws:
        BuildException
      • listBuildResultGroups

        @Deprecated
        java.util.List<java.lang.String> listBuildResultGroups()
                                                        throws BuildException
        Deprecated.
        As of release 2.0.2, replaced by getBuildGroupNames()
        Get a list of all of the build result groups.
        Returns:
        list of build groups
        Throws:
        BuildException
      • listBuildResultLabels

        @Deprecated
        java.util.List<java.lang.String> listBuildResultLabels​(java.lang.String group)
                                                        throws BuildException
        Deprecated.
        As of release 2.0.2, replaced by BuildGroup.getBuildResultLabels()
        Get a list of all build result labels within a build group.
        Parameters:
        group - Name of the build group
        Returns:
        list of build result labels
        Throws:
        BuildException
      • deleteBuildResults

        @Deprecated
        void deleteBuildResults​(java.lang.String group)
                         throws BuildException
        Deprecated.
        As of release 2.0.2, replaced by BuildGroup#deleteBuildResults(String)
        Delete all build results in a build group.
        Parameters:
        group - The name of the build group
        Throws:
        BuildException