evict the HazelCast SystemMetadata entry if we update the access control rules via Metacat's legacy API, otherwise stale SystemMetadata stays in memory instead of being looked up from the backing table store.
optionally include ORE generation/insertion into Metacat when generating SystemMetadatahttps://redmine.dataone.org/issues/2056
Set a default HazelcastInstance after init() is called, and use this instance in getLock() to acquire a lock in the cluster.
no need to cast docInfo entries to String -- they are all strings
set revision history, the create/update dates and the owner/submitter (correctly)
use shared method for looking up "docInfo" map -- both in Metacat replication and in D1 system metadata generation
make default formatting a little bit easier to read
reformat code -- no changes
refactor SystemMetadata creation into separate class from the MetacatHandler -- this will be shared by upgrade code and normal metacat api.
include all document revisions when generating "missing" system metadataTODO: revision graph captured in obsoletes/obsoletedBy
When using ILock.lock(), get a lock on the string value of the Identifier, not the Identifier object itself. Hazelcast locking won't work otherwise.
Use the Hazelcast ILock mechanism to lock the system metadata identifier rather than using IMap.lock(pid).
simplify SystemMetadata generation -- will be done during Metacat upgrade for D1 features/support.
clean up populator; use IOUtils library to do string<->stream conversions
Set sessionid for clientVeiwBean when it handle a request.Always set the order type to "allowFirst".
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
match documentation for the MN.describe() headerhttps://redmine.dataone.org/issues/1904
configure synch schedule in the admin screenhttps://redmine.dataone.org/issues/1933
look-up sych schedule from metacat properties instead of hardcoding themhttps://redmine.dataone.org/issues/1933
when comparing D1 Subject objects, use the equals() method not direct string comparisonhttps://redmine.dataone.org/issues/2050
access nodeList list correctlyhttps://redmine.dataone.org/issues/2049
When read a FGDC document, Metacat will add a new parameter enableFGDCediting params for the xml transforming.
set the uploade file size -1.
allow unknown content sizeshttp://bugzilla.ecoinformatics.org/show_bug.cgi?id=5543
run replicate() in a separate thread so that we don't wait for potentially large data objects to be moved around the system.
Call replicate() asynchronously.
Use status.toLowerCase() to deal with ReplicationStatus conversion issues. This needs to be reviewed.
Use Subject.equals() when comparing DNs rather than CertificateManager.equalsDN(). Don't lock the pid in isNodeAuthorized() to debug for timeout issues. Minor debugging changes.
give the Metacat admin users FULL permissions on all data/docshttp://bugzilla.ecoinformatics.org/show_bug.cgi?id=4728
replication control panel now fully implemented as an admin configuration screenhttp://bugzilla.ecoinformatics.org/show_bug.cgi?id=5528
move replication configuration actions to the admin servlet and out of the replication servlethttp://bugzilla.ecoinformatics.org/show_bug.cgi?id=5528
save SystemMetadata when replicating data and metadata -- this way if/when the node decides to be a DataONE MN it already has the information needed for each object
Minor logging for isNodeAuthorized(), and compare subjects properly. Change this to Subject.compareTo() when it is vetted.
check for authenticated and verified user permissions
throw NotAuthorized when there is no session
Catch RuntimeExceptions thrown by Hazelcast as opposed to general Exceptions to we don't catch exceptions we're trying to throw.
get params from multipart params for systemMetadataChanged call
generalize exception handling -- add cause detail
Changes to setReplicationStatus and isNodeAuthorized(), working out minor bugs in replication.
include exception cause when throwing new exception (combine RuntimeException in Exception handling -- they are almst identical)
throw InvalidToken when session is null
correct typo
Send the correct node id (the target node) when calling setReplicationStatus()
get pid from normal params, not the URL -- the client should include them in the params -- and not as a serialized "object" since it is just a string value
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.
Calls to setReplicationStatus() can only be made by a CN or the MN that is the target replica node. Implement this service restriction in CNodeService using CertificateManager's equalsDN() method.
The ReplicationStatus parameter is 'status', not 'replicationStatus', in the architecture documentation.
Although parameters for setReplicationStatus() are expected as multipart/form-data fields, they seem to be added to the HttpServletRequest as URL parameters during the proxy forwarding in d1_cn_rest_proxy. Test for their existence as multipart fields, but fall back to request params, otherwise, throw an InvalidRequest exception.
lookup stylesheet from metacat.properties for CN list objects and list formats. This is used in conjunction with the CN rest service deployment where the xslt is actually kept.
actually persist the MN id value to the properties file
set the newly assigned MN id after we call CN.register().
Added stack trace debugging for CNodeService.isNodeAuthorized() for tracking down replication issues.
DataONE MN registration/configuration is now its own configuration page in the admin interface.http://bugzilla.ecoinformatics.org/show_bug.cgi?id=5531
Since we're using a multipart form to encode parameters, extract the params out of the multipart form prior to doing a get() from the multipartparams map in setReplicationStatus(). Likewise, do the same in updateReplicationMetadata() and setReplicationPolicy().
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.
more changes for http://bugzilla.ecoinformatics.org/show_bug.cgi?id=5527
get server param only when it is expected
check replication table (not keystore) for trusted server host name match
Fix cast to List<Node> in isNodeAuthorized().
List the correct REST endpoints for replication in the documentation.
upgrade to 1.0.1-SNAPSHOT DataONE jars
started replication unit test
Keep /dirtySystemMetadata as the REST endpoint for systemMetadataChanged() for now.
add note about alternative methods for getting cert/key
use prepared statement place holder (?)
use DateTimeMarshaller for all replication date transfers
print the stacktrace when there is an error -- debuggin!
use SSL to get content from stream
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.
D1NodeService get(), getSystemMetadata(), and isAuthorized() no longer throw InvalidRequest.
uses prepared statement instead of plain old statement.deprecated the DBConnection.createStatement() method to discourage direct parameter value use in favor of parameter binding.http://bugzilla.ecoinformatics.org/show_bug.cgi?id=5527
Fix getReplica() handling code for getReplica() and systemMetadataChanged(). Calls to getReplica() in MNode were calling get(), so the lack of resource handling was being missed.
Handle multipart params where the libclient methods are using them.
uses prepared statement parameter binding for querieshttp://bugzilla.ecoinformatics.org/show_bug.cgi?id=5527
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.
correctly set the prepared statement parameters for start and end date
make MNodeServiceTest pass JUnit testing
http://bugzilla.ecoinformatics.org/show_bug.cgi?id=5527
Update CNodeService to use the serialVersion parameter and compare it to the current serialVersion of the system metadata found in the hzSystemMetadata map. Throw an InvalidRequest exception if they are not equal. This affects updateReplicationMetadata(), setReplicationStatus(), setReplicationPolicy(), setAccessPolicy(), and setOwner().
Handle calls to CNReplication REST services. Modify handle() to field calls to /replicaPolicies, /replicaMetadata, /replicaAuthorizations, and /replicaNotifications. Add the isNodeAuthorized(), setReplicationPolicy(), setReplicationStatus(), and updateReplicationMetadata() methods to parse and pass multipart form data and params on to the CNodeService implementing class....
Add support for the various CNReplication calls. Add collectReplicationPolicy() to parse the policy out of the multipart form, and collectReplicaMetadata() to parse out the replica to be updated.
skip verification -- remaining TODO
verify certificate
inspect keystore entries for matching client certificate
lookup the correct property for keystore file
use HttpClient to set up SSL connection when doing replication calls -- this will use the server's configured certificate as the client certificate on the request. The server it is calling can then inspect that certificate and decide whether or not it trusts the caller.
check client-provided certificate when servicing ReplicationServlet requests.
Add updateReplicationMetadata() to the CN service implementation. This was missing from the API, and likely never called. It fully replaces the given replica item in the list of replicas in system metadata.
getReplica() should log replication events as DataONE Types.Event.replicate (vs 'getreplica')
Minor indentation cleanup.
Modify isAuthorized() to get the most up to date system metadata from the hzSystemMetadata map.
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().
Update getSystemMetadata() to lock(); get(); unlock() to ensure we have the latest version of system metadata from the hzSystemMetadata map. Remove the setAccessPolicy() method since it is being deprecated in the MNAuthorization API.change insertSystemMetadata() to use a finer grained Date object on insertion. Locking of the pid happens in the subclass prior to the insert.