Commit 665b6cb2 authored by shake's avatar shake
Browse files

Updated settings page

Fixed a bug which caused an items state to not change if a token was previously set invalid.

git-svn-id: https://subversion.umiacs.umd.edu/ace/trunk@164 f1b3a171-7291-4a19-a512-95ad0ad9394a
parent 9b81d61a
......@@ -57,14 +57,14 @@ public final class TokenAuditCallback implements ValidationCallback {
private long totalErrors = 0;
private long validTokens = 0;
private CancelCallback cancel;
// private Collection collection;
// private Collection collection;
LogEventManager logManager;
public TokenAuditCallback( Map<AceToken, MonitoredItem> itemMap,
CancelCallback callback, Collection collection, long session ) {
this.itemMap = itemMap;
this.cancel = callback;
// this.collection = collection;
// this.collection = collection;
logManager = new LogEventManager(session, collection);
}
......@@ -85,7 +85,7 @@ public final class TokenAuditCallback implements ValidationCallback {
// trans.begin();
String msg = "Exception in batch thread" + Strings.exceptionAsString(throwable);
logManager.persistCollectionEvent(LogEnum.SYSTEM_ERROR, msg, em);
// lem.abortSite(collection, "Exception in batch thread", throwable);
// lem.abortSite(collection, "Exception in batch thread", throwable);
// trans.commit();
em.close();
cancel.cancel();
......@@ -107,14 +107,15 @@ public final class TokenAuditCallback implements ValidationCallback {
if ( !token.getValid() ) {
token.setValid(true);
// LogEventManager lem = new LogEventManager(session, collection);
// String path = response.getName();
// LogEventManager lem = new LogEventManager(session, collection);
// String path = response.getName();
em.persist(logManager.createItemEvent(LogEnum.TOKEN_VALID, item.getPath()));
// em.persist(lem.validToken(path, collection));
if ( item.getState() == 'I' ) {
item.setState('A');
item.setStateChange(new Date());
}
// em.persist(lem.validToken(path, collection));
}
if ( item.getState() == 'I' ) {
item.setState('A');
item.setStateChange(new Date());
}
validTokens++;
......@@ -140,19 +141,19 @@ public final class TokenAuditCallback implements ValidationCallback {
EntityManager em = PersistUtil.getEntityManager();
// token.setLastValidated(new Date());
// token.setLastValidated(new Date());
if ( token.getValid() ) {
token.setValid(false);
// String path = response.getName();
// String path = response.getName();
String message = "Generated CSI: " + calculatedCSI + " IMS (correct) CSI: " + correctCSI;
em.persist(logManager.createItemEvent(LogEnum.TOKEN_INVALID, item.getPath(), message));
if ( item.getState() == 'A' ) {
item.setState('I');
item.setStateChange(new Date());
}
}
if ( item.getState() == 'A' ) {
item.setState('I');
item.setStateChange(new Date());
}
validTokens++;
EntityTransaction trans = em.getTransaction();
trans.begin();
......
......@@ -216,7 +216,7 @@ public class IngestThread extends Thread {
identifier, coll.getDirectory() + identifier);
em.persist(token);
item.setToken(token);
item.setState('A');
item.setState('I');
em.merge(item);
em.persist(event);
numTransactions += 3;
......
......@@ -57,6 +57,16 @@
<div class="settingsVal"><input type=text name="ims" value="${currSettings['ims']}"/></div>
<div class="settingsHelp"><img src="images/help.png" title="IMS hostname to use. Unless you deployed your own IMS, this should probably not be changed"></div>
</div>
<div class="settingsRow">
<div class="settingsName">IMS Port:</div>
<div class="settingsVal"><input type=text name="ims.port" value="${currSettings['ims.port']}"/></div>
<div class="settingsHelp"><img src="images/help.png" title="Port the IMS Host runs on."></div>
</div>
<div class="settingsRow">
<div class="settingsName">IMS Token Class:</div>
<div class="settingsVal"><input type=text name="ims.tokenclass" value="${currSettings['ims.tokenclass']}"/></div>
<div class="settingsHelp"><img src="images/help.png" title="Token class for the IMS host to use."></div>
</div>
<div class="settingsRow">
<div class="settingsName">User Management:</div>
<div class="settingsVal"><input type=text name="auth.management" value="${currSettings['auth.management']}"/></div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment