Return the new pid (not the obsoleted pid) on update(), and set the correct system metadata.
In D1NodeService.getLogRecords(), don't pass in null start and count params - set them to the defaults (0 and 1000).
MNResourceHandler.getObject() was making a call to ObjectFormat.getFmtid() when an object format was null. Check that it is not null before trying getFmtid().
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.
add hasReservation() method (NotImplemented, however)
use objectFormatIdentifier for listObjects()remove provisional system metadata indicator - Metacat will not implement reserveIdentifier()
use correct log name for the class
consistently construct username/groups for MetacatHandler calls - also consistently call isAuthorized
provisional replicate() implementation -- does not check if the session's subject is "allowed" to do this.the test also requires 2 servers -- right now it attempts to replicate with itself which will fail because of duplicate IDs
provisional version of getOperationStatistics() -- not clear if we are meant to aggregate by hour or by day
provisional getCapabilities() implementation. Much of the synchronization information and node health is omitted.
simplify the get() method -- no need to use temp files for this operation
implement d1 paging for the log record results
Reverting the resultset order in querySystemMetadata(). Thanks Ben.
Because of the new 'provisional' column, the resultset field order in querySystemMetadata() was out of order. Changed the order to reflect the new table column order.
save systemmetadata when create() is called
allow very minimal system metadata for provisional entries (CN.reserveIdentifier)
Fix a NullPointerException issue when the SubjectList in a Session is null.
Add the missing URL delimiter when building the D1 base service URL.
allow the test to read the OFL docid
check for null docid from access table -- using guid for many system meta rows
use docImpl getBytes() to preserve encodingno need to catch an exception only to throw it (those I was playing around with looking up the fmt from the d1_common lib if it was not found on the server...but this is redundant with other client code)
remove resolve() test -- not implemented in Metacat
handle data objects (not sci meta) and also set the resulting pid so that create() can succeed
catch exceptions from system meta data query and throw service failure rather than swallowing them with an error msg
handle null values from DB better when querying system metadata
Update getOperationStatistics() to reflect the change in the signature, using ObjectFormatIdentifier instead of ObjectFormat.
Modify monitor() to accept new parameters for getOperationStatisics() (fromDate, toDate) instead of 'period'. Added getDateAsUTC() to parse incoming fromDate and toDate parameter strings.
Fixed problems in IdentifierManager asSystemMetadata(), getSystemMetadata(), and querySystemMetadata() that were using ObjectFormat.toString() rather than ObjectFormat.getFmtid().getValue(). Metacat was storing the string memory pointer rather than the actual format string in the systemmetadata table.
use super class' create() methoduse string comparison for assertRelation method
beef up isAuthorized method to check for "public" access rules and also for the rights holder
do not delete if the sysmeta doesn't exist
Use 'synchronization_failed' for the event string in synchronizationFailed(), and add a TODO to use the event enum when the 0.6.3 types are updated.
return all public objects for the search() method [for now]
Changed 'guid' to 'pid' to be in line with the D1 API.
simplify the MN rest servlet mapping to match CN mappings - also streamlined the handler code to share extra path info parsing
add space to error message
route all /d1/cn/* traffic through the CNRestServlet/Handler -- inspect the pathInfo when deciding what action to take and also strip off any extra parts (like pid).include query() method pass-through to CNodeService
add the old ecogrid query code (still commented out) from the old Rest handler
allow service implementation method to throw exception when guid parameter is null
allow parameters to be omitted in reserveIdentifier handling
implement reserveIdentifier() and check whether the id is reserved when creating records (only allow the create when the Subject creating matches the Subject who reserved it -- currently stored in rightsHolder)
allow for provisional SystemMetadata records (provisional=true)
remove extraneous update() call when create() does the call for us
use monitor() return value when processing response
throw exceptions up the call stack and handle exception reporting/serialization centrally in the handle() method
use logging, not system.out
consolidate session management and parameter preparation in the superclass
throw exceptions up the call stack rather than catching and handling them differently for each possible rest path
consolidate multi part handling in the super class - subclasses need only call the appropriate helper to get access to the needed resources. superclass does some validation to make sure the files are in place in the request
cleaning up the handlers -- removing superclass methods.
refactor to use D1RestServlet and D1ResourceHandler for the D1 rest interface
deprecate the old rest servlet in favor of the new D1-specific (CN/MN) versions
MN rest servlet, handler and mappings
share getSystemMetadata (before refactoring the superclass)
share getSystemMetadata (before refactoring this superclass)
Add placeholder NotImplemented exceptions for getOperationsStatistics() and getCapabilities() in MNodeService.
Implement MNCore.ping() by testing for a successful database connection.
Minor housekeeping - tabs to spaces.
Implement update() in MNodeService. Handle both XML science metadata updates and data object updates. Keep system metadata up to date, and log the update event.
Make isScienceMetadata() protected for access from subclasses.
Add insertSystemMetadata() to D1NodeService, wrap the exception handling from calls to IdentifierManager.
Add updateSystemMetadata() to D1NodeService as a helper method to wrap the exception handling from calls to IdentifierManager.
At Ben's suggestion, add metacatUrl to D1NodeService and make it available to subclasses. Set the metacatUrl in the constructor using SystemUtil rather than all roll your own PropertyService calls. More concise. Also, log the delete event in MNodeService.delete().
add CNRestServlet and mappings for urls in the form:/d1/cn/*This extends existing code for CN-specific handling. MN handling will be analogous and is forthcoming
share the deserializer method with subclasses
throw NotAllowed in MNodeService.delete() when isAuthorized() returns false.
Implement the MNStorage.delete() MNodeService. There is debate about what permissions are needed to 'delete' an object (archive it in metacat terms): D1 'WRITE' (metacat 'write') or D1 CHANGE_PERMISSION (metacat 'all'). For now we are using CHANGE_PERMISSION until it is ironed out.
add shared operations for authorization
share tempDir method with subclasses
make RestServlet and ResourceHandler extendible for D1 CN and MN handlers
use session member variable now that we actually have it
isAuthorized: check for nulls in Session subjects, catch any unexpected errors and deny access when in doubt
remove CrudService calls in favor of MNodeService
Remove setParamsFromRequest() from D1NodeService. This was called (previously as CrudService) from ResourceHandler, but will be deprecated in favor of manually creating a param map for each method that needs to pass params on to MetacatHandler.
Implement [MN|CN]Storage.create() in D1NodeService. Since MetacatHandler requires an IP for event logging, we pass in the metacat URL (hold over from CrudService). To do this in the abstract D1NodeService, change the constructors to take metacatUrl as a parameter and get the URL from the metacat properties file in getInstance() of the subclasses. Needs testing.
include URL in resolve() method as well as placeholder for preference
Metacat does not implement CNRegister
Implement CNRead.synchronizationFailed() in MNodeService. Note: The CN URL is not yet available in the SynchronizationFailed exception, but will be once the d1_common_java exception is updated. See https://redmine.dataone.org/issues/1656. Once updated, change this method to explicitly state the CN URL making the call.
Change Metacathandler.read() to be public since it's internal to Metacat, and use read() in D1NodeService after isAuthorized() for the calling Subject from the Session object.
Implement MNRead.listObjects() in MNodeService.
Implement MNRead.describe() in MNodeService.
Implement MNRead.getChecksum() in MNodeService.
Minor formatting changes - tabs to spaces, indents, etc.
Implement [MN|CN]Read.get() in D1NodeService. Added setParamsFromRequest() to pass through parameters from the request object. Since the D1 Authorization API doesn't specify which authentication system a subject belongs to, we don't know if the subject listed is a KNB LDAP DN. isAuthorized() may return true for a mapped identity, but we don't know the DN of the KNB identity per se. This needs to be tested.
-use every Subject in the session (alt Ids and Group membership)-consolidate to single isAuthorized method
throw exception for unimplemented methods
implement resolve() method
implement assertRelation
implement CNReplication.setReplicationStatus() but with a note about selecting which replica's status should be set (right now it is all)
implement CNReplication.setReplicationPolicy
correction: implementation is CN-specific
implement getChecksum() in the superclass
implement getChecksum (retrieves from system metadata)
use shared get() method from superclass