edu.ucsb.nceas.metacat

## Class AssociateAccessPolicy

- java.lang.Object
- - edu.ucsb.nceas.metacat.AssociateAccessPolicy

-     public class AssociateAccessPolicy
      extends java.lang.Object

  This class is in order to fix a problem. It doesn't has functionality for Metacat. In Currently, some document in xml_document table doesn't have entries in xml_access table. This is okay during the old access policy. But we changed the access policy and if there is no entry in xml_access table, except owner, other person can not access it. So we need to associate with access policy in xml_access table for these doc ids. The same access policy of these docoments' data set will associate to them.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AssociateAccessPolicy(DBConnection conn)` construct an instance of the DBQuery class

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `associateAccess()` Associate the access policy of dataset to the docid which the data set id mapped
    `java.util.Vector` | `geItsDataSetIdWithouAccessEntry()` Get the docid which it's mapped dataset doesn't has access entry
    `java.util.Vector` | `getNotFoundDataSetId()` Get the docid which didn't found a dataset id to map it
    `static void` | `main(java.lang.String[] args)` the main routine used to associate access policy

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AssociateAccessPolicy

          public AssociateAccessPolicy(DBConnection conn)
                                throws java.io.IOException,
                                       java.sql.SQLException,
                                       java.lang.Exception

      construct an instance of the DBQuery class

      Generally, one would call the findDocuments() routine after creating an instance to specify the search query

      Parameters:
        `conn` - the JDBC connection that we use for the query
        `parserName` - the fully qualified name of a Java class implementing the org.xml.sax.XMLReader interface
      Throws:
        `java.io.IOException`
        `java.sql.SQLException`
        `java.lang.Exception`

  - ### Method Detail

    - #### main

          public static void main(java.lang.String[] args)

      the main routine used to associate access policy

    - #### getNotFoundDataSetId

          public java.util.Vector getNotFoundDataSetId()

      Get the docid which didn't found a dataset id to map it

    - #### geItsDataSetIdWithouAccessEntry

          public java.util.Vector geItsDataSetIdWithouAccessEntry()

      Get the docid which it's mapped dataset doesn't has access entry

    - #### associateAccess

          public void associateAccess()
                               throws java.sql.SQLException,
                                      McdbException,
                                      java.lang.Exception

      Associate the access policy of dataset to the docid which the data set id mapped
      Throws:
        `java.sql.SQLException`
        `McdbException`
        `java.lang.Exception`

Copyright © 2020 Regents of the University of California. All Rights Reserved.