use of com.forgerock.openbanking.common.model.openbanking.obie.pain00200109.Document in project box-c by UNC-Libraries.
the class OperationsMessageSender method sendSetAsPrimaryObjectOperation.
/**
* Sends set-as-primary-object operation message.
*
* @param userid id of user who triggered the operation
* @param pids objects whose primary object has changed
* @return id of operation message
*/
public String sendSetAsPrimaryObjectOperation(String userid, Collection<PID> pids) {
Element contentEl = createAtomEntry(userid, pids.iterator().next(), CDRActions.SET_AS_PRIMARY_OBJECT);
Element updateEl = new Element(CDRActions.SET_AS_PRIMARY_OBJECT.getName(), CDR_MESSAGE_NS);
contentEl.addContent(updateEl);
Element subjects = new Element("subjects", CDR_MESSAGE_NS);
updateEl.addContent(subjects);
for (PID sub : pids) {
subjects.addContent(new Element("pid", CDR_MESSAGE_NS).setText(sub.getRepositoryPath()));
}
Document msg = contentEl.getDocument();
sendMessage(msg);
LOG.debug("sent set-as-primary-object operation JMS message using JMS template: {}", this.getJmsTemplate());
return getMessageId(msg);
}
use of com.forgerock.openbanking.common.model.openbanking.obie.pain00200109.Document in project box-c by UNC-Libraries.
the class OperationsMessageSender method sendOperationMessage.
/**
* Sends a message indicating that an action has occurred on a collection of objects
*
* @param userid id of user who triggered the operation
* @param pids objects affected.
* @return id of operation message
*/
public String sendOperationMessage(String userid, CDRActions action, Collection<PID> pids) {
Element contentEl = createAtomEntry(userid, pids.iterator().next(), action);
Element editAclEl = new Element(action.getName(), CDR_MESSAGE_NS);
contentEl.addContent(editAclEl);
Element subjects = new Element("subjects", CDR_MESSAGE_NS);
editAclEl.addContent(subjects);
for (PID sub : pids) {
subjects.addContent(new Element("pid", CDR_MESSAGE_NS).setText(sub.getRepositoryPath()));
}
Document msg = contentEl.getDocument();
sendMessage(msg);
LOG.debug("sent publish operation JMS message using JMS template: {}", this.getJmsTemplate());
return getMessageId(msg);
}
use of com.forgerock.openbanking.common.model.openbanking.obie.pain00200109.Document in project box-c by UNC-Libraries.
the class OperationsMessageSender method sendMarkForDeletionOperation.
/**
* Sends a MarkForDeletion operation message, indicating that an object is being marked for deletion
* from the repository
*
* @param userid id of user who triggered the operation
* @param marked object marked for deletion
* @return id of operation message
*/
public String sendMarkForDeletionOperation(String userid, Collection<PID> marked) {
Element contentEl = createAtomEntry(userid, marked.iterator().next(), CDRActions.MARK_FOR_DELETION);
Element mark = new Element("markForDeletion", CDR_MESSAGE_NS);
contentEl.addContent(mark);
Element subjects = new Element("subjects", CDR_MESSAGE_NS);
mark.addContent(subjects);
for (PID sub : marked) {
subjects.addContent(new Element("pid", CDR_MESSAGE_NS).setText(sub.getRepositoryPath()));
}
Document msg = contentEl.getDocument();
sendMessage(msg);
LOG.debug("sent mark-for-deletion operation JMS message using JMS template: {}", this.getJmsTemplate());
return getMessageId(msg);
}
use of com.forgerock.openbanking.common.model.openbanking.obie.pain00200109.Document in project box-c by UNC-Libraries.
the class OperationsMessageSender method sendRestoreFromDeletionOperation.
/**
* Sends a RestoreFromDeletion operation message, indicating that an object is being un-marked for deletion
*
* @param userid id of user who triggered the operation
* @param unmarked object being un-marked for deletion
* @return id of operation message
*/
public String sendRestoreFromDeletionOperation(String userid, Collection<PID> unmarked) {
Element contentEl = createAtomEntry(userid, unmarked.iterator().next(), CDRActions.RESTORE_FROM_DELETION);
Element mark = new Element("restoreFromDeletion", CDR_MESSAGE_NS);
contentEl.addContent(mark);
Element subjects = new Element("subjects", CDR_MESSAGE_NS);
mark.addContent(subjects);
for (PID sub : unmarked) {
subjects.addContent(new Element("pid", CDR_MESSAGE_NS).setText(sub.getRepositoryPath()));
}
Document msg = contentEl.getDocument();
sendMessage(msg);
LOG.debug("sent restore-from-deletion operation JMS message using JMS template: {}", this.getJmsTemplate());
return getMessageId(msg);
}
use of com.forgerock.openbanking.common.model.openbanking.obie.pain00200109.Document in project box-c by UNC-Libraries.
the class OperationsMessageSender method sendReorderOperation.
@Deprecated
public String sendReorderOperation(String userid, String timestamp, PID destination, Collection<PID> reordered) {
Element contentEl = createAtomEntry(userid, destination, CDRActions.REORDER);
Element reorder = new Element("reorder", CDR_MESSAGE_NS);
contentEl.addContent(reorder);
reorder.addContent(new Element("parent", CDR_MESSAGE_NS).setText(destination.getRepositoryPath()));
Element reorderedEl = new Element("reordered", CDR_MESSAGE_NS);
reorder.addContent(reorderedEl);
if (reordered != null) {
for (PID re : reordered) {
reorderedEl.addContent(new Element("pid", CDR_MESSAGE_NS).setText(re.getRepositoryPath()));
}
}
Document msg = contentEl.getDocument();
sendMessage(msg);
return getMessageId(msg);
}
Aggregations