Skip to content

Commit

Permalink
Fixed some dependencies error when integrating with bitrepositories u…
Browse files Browse the repository at this point in the history
…sing certificates
  • Loading branch information
Søren Vejrup Carlsen committed Sep 16, 2015
1 parent 4cb48bb commit 962f9de
Show file tree
Hide file tree
Showing 6 changed files with 143 additions and 132 deletions.
84 changes: 10 additions & 74 deletions common/common-core/pom.xml
Expand Up @@ -22,83 +22,14 @@
<groupId>org.bitrepository.reference</groupId>
<artifactId>bitrepository-core</artifactId>
<version>${bitrepository.version}</version>
<!-- <exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
-->

</dependency>
<dependency>
<groupId>org.bitrepository.reference</groupId>
<artifactId>bitrepository-client</artifactId>
<version>${bitrepository.version}</version>
<!-- <exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
-->
</dependency>
<!--
<dependency>
<groupId>org.bitrepository</groupId>
<artifactId>message-xml-java</artifactId>
<version>28</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.bitrepository</groupId>
<artifactId>message-xml-xsd</artifactId>
<version>28</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-basics-runtime</artifactId>
<version>0.6.0</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.bitrepository.repository-settings</groupId>
<artifactId>repository-settings-java</artifactId>
<version>11</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.bitrepository.repository-settings</groupId>
<artifactId>repository-settings-xsd</artifactId>
<version>11</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>

</dependency>
-->

<!-- bitrepository settings complete -->

Expand Down Expand Up @@ -138,8 +69,13 @@
<artifactId>xercesImpl</artifactId>
</exclusion>
</exclusions>

</dependency>
</dependency>

<dependency>
<groupId>xalan</groupId>
<artifactId>xalan</artifactId>
<version>2.7.1</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
Expand All @@ -161,7 +97,7 @@
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.3</version>
<version>1.9</version>
</dependency>

<dependency>
Expand Down
Expand Up @@ -88,14 +88,17 @@ public class BitmagArcRepositoryClient implements ArcRepositoryClient {
private static final String BITREPOSITORY_STORE_MAX_PILLAR_FAILURES = "settings.common.arcrepositoryClient.bitrepository.storeMaxPillarFailures"; //TODO necessary?

private static final String BITREPOSITORY_COLLECTIONID = "settings.common.arcrepositoryClient.bitrepository.collectionID";


private static final String BITREPOSITORY_USEPILLAR = "settings.common.arcrepositoryClient.bitrepository.usepillar";
private final String collectionId;

private File tempdir;

private int maxStoreFailures;

private Bitrepository bitrep;
private Bitrepository bitrep;

private String usepillar;


/** Create a new BitmagArcRepositoryClient based on current settings. */
Expand All @@ -105,8 +108,9 @@ public BitmagArcRepositoryClient() {
this.collectionId = Settings.get(BITREPOSITORY_COLLECTIONID);
this.tempdir = Settings.getFile(BITREPOSITORY_TEMPDIR);
this.maxStoreFailures = Settings.getInt(BITREPOSITORY_STORE_MAX_PILLAR_FAILURES);
this.usepillar = Settings.get(BITREPOSITORY_USEPILLAR);
// Initialize connection to the bitrepository
this.bitrep = new Bitrepository(configDir, keyfile, maxStoreFailures);
this.bitrep = new Bitrepository(configDir, keyfile, maxStoreFailures, usepillar);
}

@Override
Expand Down Expand Up @@ -135,7 +139,7 @@ public void store(File file) throws IOFailure, ArgumentNotValid {
if (!uploadSuccessful) {
throw new IOFailure("Upload to collection '" + collectionId + "' of file '" + file.getName() + "' failed.");
} else {
log.info("Upload to collection '{}' of file '{}' was successfull", collectionId, file.getName());
log.info("Upload to collection '{}' of file '{}' was successful", collectionId, file.getName());
}
}
}
Expand Down Expand Up @@ -227,12 +231,15 @@ public BatchStatus batch(final FileBatchJob job, String replicaId, String... arg
IOFailure {
ArgumentNotValid.checkNotNull(job, "FileBatchJob job");
ArgumentNotValid.checkNotNullOrEmpty(replicaId, "String replicaId");
//FIXME
// Use this pattern to request the fileIds to match this pattern
// and then fetch the matching files to local storage
//Pattern filenamePattern = job.getFilenamePattern;


//FIXME
// Use this pattern to request the fileIds to match this pattern
// and then fetch the matching files to local storage
//Pattern filenamePattern = job.getFilenamePattern;

log.info("pattern: " + job.getFilenamePattern().pattern());
System.out.println("pattern: " + job.getFilenamePattern().pattern());


OutputStream os = null;
File resultFile;
try {
Expand Down Expand Up @@ -375,5 +382,10 @@ public File correct(String replicaId, String checksum, File file, String credent
public String getChecksum(String replicaId, String filename) throws ArgumentNotValid {
throw new NotImplementedException("getChecksum is not implemented here");
}

public Bitrepository getBitrepository() {
return this.bitrep;
}


}

0 comments on commit 962f9de

Please sign in to comment.