Package edu.ucsb.nceas.metacat.dataone
Class SyncAccessPolicy
java.lang.Object
edu.ucsb.nceas.metacat.dataone.SyncAccessPolicy
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
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
Run pid synch script on the given pids Each argument is an individual pid because pids cannot contain whitespace.List<org.dataone.service.types.v1.Identifier>
Convenience function that accepts a list of guids to syncvoid
syncAll()
For all guids for which current MN is authoritative, check that access policy is synced with CN.
-
Constructor Details
-
SyncAccessPolicy
public SyncAccessPolicy()
-
-
Method Details
-
sync
public List<org.dataone.service.types.v1.Identifier> sync(List<String> guidsToSync) throws 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, SQLException, 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:
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
SQLException
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, NumberFormatException, AccessionNumberException, SQLException, edu.ucsb.nceas.utilities.PropertyNotFoundException, ServiceException, ExceptionFor 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
NumberFormatException
AccessionNumberException
SQLException
edu.ucsb.nceas.utilities.PropertyNotFoundException
ServiceException
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 comparisonap2
- - second access policy in the comparison- Returns:
- boolean - true if access policies are equivalent
-
main
Run pid synch script on the given pids Each argument is an individual pid because pids cannot contain whitespace.- Parameters:
args
-- Throws:
Exception
-