New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
repository: added support for tx calls #31
Conversation
@gushakov, Thank you for this. Can you please submit an iCLA: @mikedurbin or @escowles, I am on travel this week. Will you have some time to review this, and create a JIRA ticket? |
I've created https://jira.duraspace.org/browse/FCREPO-1762 and should have time to review this today or tomorrow. |
// check if path needs to be prepended with a slash | ||
final String txId = TransactionIdHolder.getCurrentTransactionId(); | ||
return (txId == null || path.contains(TX)) | ||
? path : (path.startsWith("/") ? "/" + txId + path : txId + "/" + path); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be good to avoid nested ?: conditions -- they are hard enough to read without being nested.
@gushakov: This looks good -- I have a few minor comments, and this looks ready to merge once those are addressed and your CLA is signed. |
Just sent my iCLA. As suggested:
|
👍 -- this looks ready to merge as soon as your CLA is |
} | ||
|
||
} catch (final Exception e) { | ||
LOGGER.error("could not encode URI parameter", e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do not dump exception stacktraces into the log. Instead, print the e.getMessage()
.
Thanks for this, @gushakov. Could you please let me know what your https://jira.duraspace.org user-id is so that we can associate you to this ticket: |
Instead of dumping a full stacktrace to the log, the convention within Fedora is to instead append the Exception.getMessage() to the specified error. fcrepo4-labs#31 (comment)
Instead of dumping a full stacktrace to the log, the convention within Fedora is to instead append the Exception.getMessage() to the specified error. fcrepo4-labs#31 (comment)
This work was completed with: #36 |
Modified
FedoraRepositoryImpl
slightly to add some useful calls to RESTfull API to deal with transactions. Based on the description given at https://wiki.duraspace.org/display/FEDORA4x/RESTful+HTTP+API+-+TransactionsThe idea is to be able to do something like this.
The transaction IDs (with
tx:
prefix) are stored inThreadLocal<String>
attribute of the static utility class.