Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
testing for AWS client creation and node property creation in sequencer
- Loading branch information
Showing
11 changed files
with
453 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
fcrepo-glacier/src/main/resources/config/glacier-backup.cnd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* JCR node types for use with Fedora | ||
*/ | ||
<fcrepo = 'http://fcrepo.org/'> | ||
<glacier = 'http://fcrepo.org/glacier/'> | ||
<jcr = 'http://www.jcp.org/jcr/1.0'> | ||
<nt = 'http://www.jcp.org/jcr/nt/1.0'> | ||
|
||
/* | ||
* <mix = 'http://www.jcp.org/jcr/mix/1.0'> | ||
* | ||
* [fcrepo:resource] > mix:created, mix:lastModified, mix:lockable, mix:versionable mixin abstract | ||
* - fcrepo:created (STRING) COPY | ||
*/ | ||
|
||
[fcrepo:glacier.backup] > nt:file mixin | ||
- glacier:checksum (STRING) mandatory | ||
- glacier:archive.id (STRING) mandatory | ||
- glacier:location (STRING) mandatory | ||
- glacier:vault (STRING) mandatory |
This file was deleted.
Oops, something went wrong.
49 changes: 49 additions & 0 deletions
49
fcrepo-glacier/src/test/java/org/fcrepo/events/SequencingTestListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package org.fcrepo.events; | ||
|
||
import static org.modeshape.jcr.api.observation.Event.Sequencing.NODE_SEQUENCED; | ||
import static org.modeshape.jcr.api.observation.Event.Sequencing.OUTPUT_PATH; | ||
import static org.modeshape.jcr.api.observation.Event.Sequencing.SELECTED_PATH; | ||
import static org.modeshape.jcr.api.observation.Event.Sequencing.SEQUENCED_NODE_ID; | ||
import static org.modeshape.jcr.api.observation.Event.Sequencing.SEQUENCED_NODE_PATH; | ||
import static org.modeshape.jcr.api.observation.Event.Sequencing.SEQUENCER_NAME; | ||
import static org.modeshape.jcr.api.observation.Event.Sequencing.USER_ID; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
import java.util.concurrent.ConcurrentHashMap; | ||
|
||
import javax.jcr.Node; | ||
import javax.jcr.RepositoryException; | ||
import javax.jcr.observation.EventIterator; | ||
import javax.jcr.observation.EventListener; | ||
|
||
import org.modeshape.jcr.api.observation.Event; | ||
|
||
public class SequencingTestListener implements EventListener { | ||
|
||
private ConcurrentHashMap<String, Event> sequencingEvents; | ||
private final Map<String, Node> sequencedNodes = new HashMap<String, Node>(); | ||
|
||
public SequencingTestListener(ConcurrentHashMap<String, Event> sequencingEvents) { | ||
this.sequencingEvents = sequencingEvents; | ||
} | ||
|
||
@Override | ||
public void onEvent(EventIterator events) { | ||
while (events.hasNext()) { | ||
try { | ||
Event event = (Event)events.nextEvent(); | ||
Map info = event.getInfo(); | ||
for (Object key: info.keySet()){ | ||
System.err.println("EVENT: " + key + " => " + info.get(key)); | ||
} | ||
sequencingEvents.putIfAbsent((String)event.getInfo().get(SEQUENCED_NODE_PATH), event); | ||
|
||
} catch (Exception e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.