Skip to Content.
Sympa Menu

idok-commit - [idok-commit] idok commit r232 - in branches/rest/java/ch/idok/service/server/admin: . corba

idok-commit AT lists.psi.ch

Subject: Commit emails of the iDok project

List archive

[idok-commit] idok commit r232 - in branches/rest/java/ch/idok/service/server/admin: . corba


Chronological Thread 
  • From: "AFS account Roman Geus" <geus AT savannah.psi.ch>
  • To: idok-commit AT lists.psi.ch
  • Subject: [idok-commit] idok commit r232 - in branches/rest/java/ch/idok/service/server/admin: . corba
  • Date: Wed, 24 Sep 2008 09:04:36 +0200
  • List-archive: <https://lists.web.psi.ch/pipermail/idok-commit/>
  • List-id: Commit emails of the iDok project <idok-commit.lists.psi.ch>

Author: geus
Date: Wed Sep 24 09:04:35 2008
New Revision: 232

Log:
Moved apacheConfUpdaterThread from AdminServiceImpl.java to Admin.java


Modified:
branches/rest/java/ch/idok/service/server/admin/Admin.java

branches/rest/java/ch/idok/service/server/admin/PermissionAdapterFactory.java
branches/rest/java/ch/idok/service/server/admin/corba/AdminServiceImpl.java

Modified: branches/rest/java/ch/idok/service/server/admin/Admin.java
==============================================================================
--- branches/rest/java/ch/idok/service/server/admin/Admin.java (original)
+++ branches/rest/java/ch/idok/service/server/admin/Admin.java Wed Sep 24
09:04:35 2008
@@ -92,7 +92,23 @@
}

}
+
+ /** Thread updating the Apache configuration */
+ static private ApacheConfUpdaterThread apacheConfUpdaterThread;

+ static {
+ // Start background thread, that updates the Apache configuration
+ apacheConfUpdaterThread = new
ApacheConfUpdaterThread(PermissionAdapterFactory.getAdapter());
+ apacheConfUpdaterThread.start();
+ }
+
+ /**
+ * Force update of the apache/mod_dav_svn authorization configuration
+ */
+ static public void forceAuthzUpdate() {
+ apacheConfUpdaterThread.forceUpdate();
+ }
+
/**
* Create new iDok project.
*
@@ -316,7 +332,7 @@
Matcher m = projectAndRepositoryNamePattern.matcher(name);
if (!m.matches()) {
throw new DmsException(ErrorType.BAD_ARG, null,
- "Invalid project or repository name " + name, "");
+ "Invalid project, repository or schema name " + name,
"");
}
}


Modified:
branches/rest/java/ch/idok/service/server/admin/PermissionAdapterFactory.java
==============================================================================
---
branches/rest/java/ch/idok/service/server/admin/PermissionAdapterFactory.java
(original)
+++
branches/rest/java/ch/idok/service/server/admin/PermissionAdapterFactory.java
Wed Sep 24 09:04:35 2008
@@ -40,7 +40,7 @@
return _instance;
}

- public static PermissionAdapter getAdapter() {
+ public static synchronized PermissionAdapter getAdapter() {
PermissionAdapterFactory me = getInstance();
if (me.prepare())
return me.getHandlerInternal();
@@ -48,9 +48,6 @@
return null;
}

- public PermissionAdapterFactory() {
- }
-
protected PermissionAdapter getHandlerInternal() {
return _adapter;
}
@@ -67,6 +64,7 @@
}

public PermissionAdapter instantiateAdapter() {
+ logger_.finest("PermissionAdapterFactory::instantiateAdapter");
// This class could be loaded dynamically
return new PermissionRoleDBAdapter();
}

Modified:
branches/rest/java/ch/idok/service/server/admin/corba/AdminServiceImpl.java
==============================================================================
---
branches/rest/java/ch/idok/service/server/admin/corba/AdminServiceImpl.java
(original)
+++
branches/rest/java/ch/idok/service/server/admin/corba/AdminServiceImpl.java
Wed Sep 24 09:04:35 2008
@@ -51,10 +51,9 @@
import ch.idok.service.common.common.corba.obj.FileWriteIteratorHelper;
import ch.idok.service.common.common.corba.obj.ServiceException;
import ch.idok.service.server.admin.Admin;
-import ch.idok.service.server.admin.ApacheConfUpdaterThread;
+import ch.idok.service.server.admin.DmsLdap;
import ch.idok.service.server.admin.PermissionAdapter;
import ch.idok.service.server.admin.PermissionAdapterFactory;
-import ch.idok.service.server.admin.DmsLdap;

/**
* This class implements the "Admin" CORBA interface on the server side.
@@ -99,9 +98,6 @@
}
}

- /** Thread updating the Apache configuration */
- private ApacheConfUpdaterThread apacheConfUpdaterThread_;
-
/**
* Construct servant
*/
@@ -109,10 +105,6 @@
orb_ = orb;
poa_ = poa;
adapter_ = PermissionAdapterFactory.getAdapter();
-
- // Start background thread, that updates the Apache configuration
- apacheConfUpdaterThread_ = new ApacheConfUpdaterThread(adapter_);
- apacheConfUpdaterThread_.start();
}

/**
@@ -176,7 +168,7 @@
+ " does not have sufficient
permissions for this operation");
}
adapter_.initAuthDB(masterAdminName_);
- apacheConfUpdaterThread_.forceUpdate();
+ Admin.forceAuthzUpdate();
} catch (Throwable e) {
logger_.log(Level.WARNING, e.getMessage(), e);
throw Util.toServiceException(e);
@@ -238,7 +230,7 @@
AuthUtil.getUserPrincipal(subject).getName(), project,
repository);
// FIXME: not efficient
- apacheConfUpdaterThread_.forceUpdate();
+ Admin.forceAuthzUpdate();
} catch (Throwable e) {
logger_.log(Level.WARNING, e.getMessage(), e);
throw Util.toServiceException(e);
@@ -265,7 +257,7 @@
"admin");
adapter_.revokePermissionImplies(perm);
// FIXME: not efficient
- apacheConfUpdaterThread_.forceUpdate();
+ Admin.forceAuthzUpdate();
} catch (Throwable e) {
logger_.log(Level.WARNING, e.getMessage(), e);
throw Util.toServiceException(e);
@@ -359,7 +351,7 @@
// permission
aa(cred, new DmsPermission(task, "admin"), adapter_);
adapter_.grantPermission(name, new DmsPermission(task, action));
- apacheConfUpdaterThread_.forceUpdate();
+ Admin.forceAuthzUpdate();
} catch (Throwable e) {
logger_.log(Level.WARNING, e.getMessage(), e);
throw Util.toServiceException(e);
@@ -384,7 +376,7 @@
DmsPermission grant = new DmsPermission(task, "admin");
aa(cred, grant, adapter_);
adapter_.revokePermission(name, grant);
- apacheConfUpdaterThread_.forceUpdate();
+ Admin.forceAuthzUpdate();
} catch (Throwable e) {
logger_.log(Level.WARNING, e.getMessage(), e);
throw Util.toServiceException(e);
@@ -506,7 +498,7 @@
aa(cred, grant, adapter_);

adapter_.addToGroup(name, group);
- apacheConfUpdaterThread_.forceUpdate();
+ Admin.forceAuthzUpdate();
} catch (Throwable e) {
logger_.log(Level.WARNING, e.getMessage(), e);
throw Util.toServiceException(e);
@@ -566,7 +558,7 @@
DmsPermission grant = new DmsPermission(group, "admin");
aa(cred, grant, adapter_);
adapter_.removeFromGroup(name, group);
- apacheConfUpdaterThread_.forceUpdate();
+ Admin.forceAuthzUpdate();
} catch (Throwable e) {
logger_.log(Level.WARNING, e.getMessage(), e);
throw Util.toServiceException(e);



  • [idok-commit] idok commit r232 - in branches/rest/java/ch/idok/service/server/admin: . corba, AFS account Roman Geus, 09/24/2008

Archive powered by MHonArc 2.6.19.

Top of Page