edu.ucsb.nceas.metacat.dataone

## Class SyncAccessPolicy

- java.lang.Object
- - edu.ucsb.nceas.metacat.dataone.SyncAccessPolicy

-     public class SyncAccessPolicy
      extends java.lang.Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SyncAccessPolicy()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `isEqual(org.dataone.service.types.v1.AccessPolicy ap1, org.dataone.service.types.v1.AccessPolicy ap2)` Compare two d1 system metadata access policies for equivalence.
    `static void` | `main(java.lang.String[] args)` Run pid synch script on the given pids Each argument is an individual pid because pids cannot contain whitespace.
    `java.util.List<org.dataone.service.types.v1.Identifier>` | `sync(java.util.List<java.lang.String> guidsToSync)` Convenience function that accepts a list of guids to sync
    `void` | `syncAll()` For all guids for which current MN is authoritative, check that access policy is synced with CN.

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

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

- - ### Constructor Detail

    - #### SyncAccessPolicy

          public SyncAccessPolicy()

  - ### Method Detail

    - #### sync

          public java.util.List<org.dataone.service.types.v1.Identifier> sync(java.util.List<java.lang.String> guidsToSync)
                                                                       throws java.lang.NumberFormatException,
                                                                              org.dataone.service.exceptions.ServiceFailure,
                                                                              org.dataone.service.exceptions.InvalidToken,
                                                                              org.dataone.service.exceptions.NotAuthorized,
                                                                              org.dataone.service.exceptions.NotFound,
                                                                              org.dataone.service.exceptions.NotImplemented,
                                                                              McdbDocNotFoundException,
                                                                              org.dataone.service.exceptions.InvalidRequest,
                                                                              org.dataone.service.exceptions.VersionMismatch,
                                                                              AccessionNumberException,
                                                                              java.sql.SQLException,
                                                                              java.lang.Exception

      Convenience function that accepts a list of guids to sync
      Parameters:
        `guidsToSync` - list of guids to have access policy synced for
      Returns:
        syncedPids - list of pids that were actually synced with the CN
      Throws:
        `java.lang.NumberFormatException`
        `org.dataone.service.exceptions.ServiceFailure`
        `org.dataone.service.exceptions.InvalidToken`
        `org.dataone.service.exceptions.NotAuthorized`
        `org.dataone.service.exceptions.NotFound`
        `org.dataone.service.exceptions.NotImplemented`
        `McdbDocNotFoundException`
        `org.dataone.service.exceptions.InvalidRequest`
        `org.dataone.service.exceptions.VersionMismatch`
        `AccessionNumberException`
        `java.sql.SQLException`
        `java.lang.Exception`

    - #### syncAll

          public void syncAll()
                       throws org.dataone.service.exceptions.ServiceFailure,
                              org.dataone.service.exceptions.InvalidToken,
                              org.dataone.service.exceptions.NotAuthorized,
                              org.dataone.service.exceptions.NotFound,
                              org.dataone.service.exceptions.NotImplemented,
                              McdbDocNotFoundException,
                              org.dataone.service.exceptions.InvalidRequest,
                              org.dataone.service.exceptions.VersionMismatch,
                              java.lang.NumberFormatException,
                              AccessionNumberException,
                              java.sql.SQLException,
                              edu.ucsb.nceas.utilities.PropertyNotFoundException,
                              ServiceException,
                              java.lang.Exception

      For all guids for which current MN is authoritative, check that access policy is synced with CN.
      Throws:
        `org.dataone.service.exceptions.ServiceFailure`
        `org.dataone.service.exceptions.InvalidToken`
        `org.dataone.service.exceptions.NotAuthorized`
        `org.dataone.service.exceptions.NotFound`
        `org.dataone.service.exceptions.NotImplemented`
        `McdbDocNotFoundException`
        `org.dataone.service.exceptions.InvalidRequest`
        `org.dataone.service.exceptions.VersionMismatch`
        `java.lang.NumberFormatException`
        `AccessionNumberException`
        `java.sql.SQLException`
        `edu.ucsb.nceas.utilities.PropertyNotFoundException`
        `ServiceException`
        `java.lang.Exception`

    - #### isEqual

          public boolean isEqual(org.dataone.service.types.v1.AccessPolicy ap1,
                                 org.dataone.service.types.v1.AccessPolicy ap2)

      Compare two d1 system metadata access policies for equivalence.
      Parameters:
        `ap1` - - first access policy in the comparison
        `ap2` - - second access policy in the comparison
      Returns:
        boolean - true if access policies are equivalent

    - #### main

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

      Run pid synch script on the given pids Each argument is an individual pid because pids cannot contain whitespace.
      Parameters:
        `args` -
      Throws:
        `java.lang.Exception`

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