Don't set the replication status to failed for an object when it is called by a public user. Just throw the NotAuthorized exception. This prevents this node from being de-prioritized because of public calls to the method.
handle authorization for delete() differently for CN vs MN.On the CN, only the CN (or tbd admin user) can call it.On the MN, both the CN (or admin user) and the same MN can call it.
include Session-less interface methods and updated jars that define them.
remove extraneous pid and permission parameters from isAdminAuthorized() method and make public so that it can be called in other locations - namely before our asynchronous replicate() implementation on the MN.
added comments and logging about https://redmine.dataone.org/issues/2572
generalize the exception handling because our actions are the same no matter what the specific error is during create - we just notify the CN that the replicate call failed
catch general Exception that may be thrown during MN.replicate() when creating the object locally. There are a few records that keep slipping off our radar with no explanation as to why they remain in "REQUESTED" status.
additional logging in MN.replicate()
change ordering of getLogRecords() parameter -- pidFilter is in the middle now
upgrade to latest RC in libclient and common jars -- includes updated getLogRecords and new mn.generateIdentifier method
add logging statements when there is a problem calling setReplicationStatus
Don't check for populated obsoletes and obsoletedBy fields during CN.create(), only MN.create(). The CN should expect that the MN has populated this field because of existing revision information, and should trust the MN information. Addresses https://redmine.dataone.org/issues/2507.
Some minor logging changes.
use isAdminAuthorized() to check access to CN.create(). Note this method takes a pid and permission parameter and neither is used. Also removed the NotFound exception because it would never come up.
include CN.delete()https://redmine.dataone.org/issues/2506
Only allow CNs to call MN.synchronizationFailed() by calling isAdminAuthorized(). The pid must also be valid.
do not replicate if session is null
Globally change the property 'dataone.memberNodeId' to 'dataone.nodeId'. This is more useful for both MNs and CNs implemented in Metacat. Also, change D1NodeService.getLogRecords() to return log entries with the actual node id rather than the IP address (looks like a cut/paste error)....
throw InvalidToken when an invalid Permission is passed in. THis requires that internal calls to the method also check for this exception.https://redmine.dataone.org/issues/2388
actually, let's set the serialVersion during the MN.create() call so that the HZ map and the backing store have the same information immediately. Also, this is how the docs specify it.http://mule1.dataone.org/ArchitectureDocs-current/design/SystemMetadata.html
match changes to MN service methods (return type as boolean)
Clean up warnings in class.
fix a bug in MNodeService.replicate() where the checksum value was being compared to the computed checksum object, not its value.
In MN.getCapabilities(), the required contact subject was not being added to the node instance from the dataone properties. Add it in.
use RC-1 Dataone jars
On MN.create(), set the archived flag to be false. This field isn't required in the schema, but is needed by the DataONE indexer once objects are sync'd.
Minor null checks to avoid NPEs when calling replicate()
Make sure the local id isn't null when we try to get the object from the local instance.
Simplify the error handling, and throw the exception once the CN is updated with the new status.
Set the replica status to failed (not invalidated) when we get exceptions trying to read the object bytes. Not much of a difference, but only the CN, in theory, is supposed to be able to set the invalidated status.
Set the replication status to invalidated when we have a localId, but getting the object bytes fails for any reason.
Only call super.create() if there's no localId found on the MN (ie a replica is there from an out of band process).
Get the object inputstream from the local metacat instance using MetacatHandler.get() rather than MN.getReplica() so we don't throw an InvalidToken exception when passing in a null Session. The D1Client object is never used for this local call.
new jars with many changes -- including new CN methods: ping, describe, listChecksumAlgorithm. Removed MN.setAccessPolicy. Refactored CN.setOwner() to CN.setRightsHolder().
In the call to MNReplication.replicate(), call back to CNReplication.setReplicationStatus() and set the status to failed when we get local exceptions, exceptions from the source MN when calling getReplica(). Send back an exception with a description when setting the status. Add a private setReplicationStatus() method to refactor these calls out.
set SystemMetadata.archived=true on MN.deleteThere is ongoing discussion on what the exact behavior should be here, but this mimics Metacat's delete-as-archive action.http://redmine.dataone.org/issues/882
In MNodeService.replicate(), check to see if we have a replica (via an out of band channel) before we call sourceMN.getReplica().
updated D1 API -- removed Permission.REPLICATE and associated parameters
include SerialVersion in describe responsehttps://redmine.dataone.org/issues/2135NOTE: d1 jars should be replaced once all schema changes are finalized and the generate d1_common code is committed to svn
verify checksum when retrieving replica from another member node.https://redmine.dataone.org/issues/1794
make sure to get/put system metadata to the HZ map instead of using IdentifierManager directlyverified changes for: https://redmine.dataone.org/issues/1999
look-up sych schedule from metacat properties instead of hardcoding themhttps://redmine.dataone.org/issues/1933
throw NotAuthorized when there is no session
throw InvalidToken when session is null
Send the correct node id (the target node) when calling setReplicationStatus()
check obsoletes and obsoletedBy PIDs when updating objects
delete system metadata when MN.delete() is called.
throw InvalidToken when there is no session (certificate) provided in update() and delete() methods.
Use a session object that is set to null when calling CNode.setReplicationStatus()
Add debugging code to MNodeService.getReplica().
Set a new Session object to null, to be overwritten by the CertificateManager session information from the X.509 certificate.
upgrade to 1.0.1-SNAPSHOT DataONE jars
Update methods in MNodeService to reflect they modifications of the MN API with regard to exceptions being raised. Largely removed InvalidRequest from a number of methods, and instead threw an appropriate NotFound or ServiceFailure instead.
Add in the systemMetadataChanged() method in MNodeService to respond to notifications. Only allow subjects from CNs listed in the node list to make the call. Update the local copy of the system metadata document for the given pid.
Include the serialVersion in the call to CN.setReplicationStatus() after replicating data.
getReplica() should log replication events as DataONE Types.Event.replicate (vs 'getreplica')
Minor indentation cleanup.
Add a placeholder setAccessPolicy() method in MNodeService that throws NotImplemented since this method is being deprecated. Note: need to confirm that this shouldn't be calling D1Client.getCN().setAccessPolicy().
move the DataONE 1.0.0-SNAPSHOT
Configure and use CertificateManager in order to act as the MN when performing replicate() and getReplica() mthods.
add User-Agent logging to support D1 requirements
Add debugging output to MNodeService.
update D1 jars to include recent SubjectList -> SubjectInfo refactoring and the SUBJECT_PUBLIC constant
throw InvalidToken when the Session parameter is null for create()https://redmine.dataone.org/issues/1850
Once a CN calls replicate() on an MN, the MN needs to call getReplica() on the source MN (not get()). Once the bytes are retrieved, the MN must then call back to the CN with setReplicationStatus() to indicate that the replication status is complete. Modify MNodeService to do so.
set date uploaded and date system metadata updated date to current time when calling MN.create() and MN.update()
set the originating member node on update()
set the originating member node on create()
set sysmeta submitter based on the subject given in the certificate
Modified cron schedule to fix the incorrect crontab entry.
do not require ID reservation before create() or update()
check for null session before logging sync failedhttps://redmine.dataone.org/issues/1798
correctly implement MN.describehttps://redmine.dataone.org/issues/1799
Added subject field to getCapabilities() call.
Fix getCapabilities to properly throw ServiceFailure when properties can not be read, rather than failing with a log message. Fix properties in the Node object to reflect their correct values. Set the sync schedule properly to default to 5 minute intervals. Improve documentation.
Reformatted to correct indentation to make class readable.
newer d1 jars -- contains CN.isNodeAuthorized() method
Reverting previous @Overrides chanrge from r6470, as that is the desiredbehavior under Java 1.6 -- previous versions of Java (e.g., 1.5) will notcomile with this usage of the @Overrides annotation, but the currentlysupported version will. So reverting to the 1.6 convention.
Removing incorrect @Override annotations that were preventing compilation. The methods marked did not actually override a method in the superclass, so they were not compiling. I think @Overrides was being mistaken for methods that implement an interface but aren't actually in the superclass.
changes for schema update (d1_common)
use InvalidRequest when the PID is not found. https://redmine.dataone.org/issues/1768
use Permission.REPLICATE not EXECUTE
check with the CN if replication is allowed for the object in question for getReplica()
add getReplica() implementation. same as get() but with different logging. seems silly, but maybe I missed something important that distinguishes this method.
Update classes to use the DataONE 0.6.4 schema and types. Major changes involve using BigInteger vs long in SystemMetadata.size, and using ObjectFormatIdentifier rather than Object format.
Insert system metadata after the data object is inserted.
Update the d1 common java jar to include the changes to BaseException, and update MNodeService.synchronizationFailed() to use the BaseException.getNodeId() method to report which node the exception came from.
use correct enum method
refactor Constants
remove ServiceTypeUtil - replace with TypeMarshaller
use new "v1" types from DataONE
Return the new pid (not the obsoleted pid) on update(), and set the correct system metadata.
In MNodeService.getCapabilities(), update the properties to match those in metacat.properties. Flesh out the NodeHealth object, adding NodeState, Ping, and Status information. Flesh out the Synchronization object information, but for now, use mock values. TODO: This should be determined from configuration and on-the-fly information.
In MNodeService.getCapabilities(), set the synchronization and replication properties of the node.
In MNodeService.getCapabilities(), set the serviceAvailable for each service supported.
In MNodeService.getCapabilities(), set the serviceVersion for each service supported.
check reservation before create/update
Use D1 properties to set node values, and add the 'WAR VERSION' back into the node name for deployments.
use objectFormatIdentifier for listObjects()remove provisional system metadata indicator - Metacat will not implement reserveIdentifier()
consistently construct username/groups for MetacatHandler calls - also consistently call isAuthorized