Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.osee.framework.access.provider/src/org/eclipse/osee/framework/access/provider/internal/DefaultFrameworkAccessConstants.java (renamed from plugins/org.eclipse.osee.framework.access.provider/src/org/eclipse/osee/framework/access/provider/internal/DefaultFrameworkAccessContstants.java)4
-rw-r--r--plugins/org.eclipse.osee.framework.access.provider/src/org/eclipse/osee/framework/access/provider/internal/FrameworkAccessControlProxy.java60
-rw-r--r--plugins/org.eclipse.osee.framework.access.provider/src/org/eclipse/osee/framework/access/provider/internal/FrameworkDslProvider.java33
-rw-r--r--plugins/org.eclipse.osee.framework.access.provider/src/org/eclipse/osee/framework/access/provider/internal/config/FrameworkAccessConfig.java4
-rw-r--r--plugins/org.eclipse.osee.framework.access/OSGI-INF/access.control.service.xml2
-rw-r--r--plugins/org.eclipse.osee.framework.access/OSGI-INF/access.provider.admin.xml2
-rw-r--r--plugins/org.eclipse.osee.framework.access/build.properties3
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.integration/OSGI-INF/osee.dsl.modeling.service.xml2
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/OSGI-INF/access.policy.service.xml2
9 files changed, 69 insertions, 43 deletions
diff --git a/plugins/org.eclipse.osee.framework.access.provider/src/org/eclipse/osee/framework/access/provider/internal/DefaultFrameworkAccessContstants.java b/plugins/org.eclipse.osee.framework.access.provider/src/org/eclipse/osee/framework/access/provider/internal/DefaultFrameworkAccessConstants.java
index 1d5654fa44..da2514e542 100644
--- a/plugins/org.eclipse.osee.framework.access.provider/src/org/eclipse/osee/framework/access/provider/internal/DefaultFrameworkAccessContstants.java
+++ b/plugins/org.eclipse.osee.framework.access.provider/src/org/eclipse/osee/framework/access/provider/internal/DefaultFrameworkAccessConstants.java
@@ -16,9 +16,9 @@ import org.eclipse.osee.framework.core.data.TokenFactory;
/**
* @author John Misinco
*/
-public final class DefaultFrameworkAccessContstants {
+public final class DefaultFrameworkAccessConstants {
- private DefaultFrameworkAccessContstants() {
+ private DefaultFrameworkAccessConstants() {
//do nothing
}
diff --git a/plugins/org.eclipse.osee.framework.access.provider/src/org/eclipse/osee/framework/access/provider/internal/FrameworkAccessControlProxy.java b/plugins/org.eclipse.osee.framework.access.provider/src/org/eclipse/osee/framework/access/provider/internal/FrameworkAccessControlProxy.java
index 294991ddeb..faf79d9c9d 100644
--- a/plugins/org.eclipse.osee.framework.access.provider/src/org/eclipse/osee/framework/access/provider/internal/FrameworkAccessControlProxy.java
+++ b/plugins/org.eclipse.osee.framework.access.provider/src/org/eclipse/osee/framework/access/provider/internal/FrameworkAccessControlProxy.java
@@ -10,19 +10,34 @@
*******************************************************************************/
package org.eclipse.osee.framework.access.provider.internal;
+import java.util.Arrays;
import java.util.Collection;
+import java.util.List;
+import java.util.logging.Level;
import org.eclipse.osee.framework.core.data.IAccessContextId;
import org.eclipse.osee.framework.core.dsl.integration.AccessModelInterpreter;
import org.eclipse.osee.framework.core.dsl.integration.OseeDslAccessModel;
-import org.eclipse.osee.framework.core.dsl.integration.OseeDslProvider;
import org.eclipse.osee.framework.core.dsl.integration.RoleContextProvider;
import org.eclipse.osee.framework.core.dsl.ui.integration.operations.OseeDslRoleContextProvider;
+import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
+import org.eclipse.osee.framework.core.enums.CoreBranches;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.IBasicArtifact;
import org.eclipse.osee.framework.core.model.access.AccessModel;
import org.eclipse.osee.framework.core.model.access.HasAccessModel;
import org.eclipse.osee.framework.core.services.CmAccessControl;
import org.eclipse.osee.framework.core.util.Conditions;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.event.OseeEventManager;
+import org.eclipse.osee.framework.skynet.core.event.filter.ArtifactEventFilter;
+import org.eclipse.osee.framework.skynet.core.event.filter.ArtifactTypeEventFilter;
+import org.eclipse.osee.framework.skynet.core.event.filter.BranchGuidEventFilter;
+import org.eclipse.osee.framework.skynet.core.event.filter.IEventFilter;
+import org.eclipse.osee.framework.skynet.core.event.listener.IArtifactEventListener;
+import org.eclipse.osee.framework.skynet.core.event.listener.IEventListener;
+import org.eclipse.osee.framework.skynet.core.event.model.ArtifactEvent;
+import org.eclipse.osee.framework.skynet.core.event.model.Sender;
/**
* @author John Misinco
@@ -32,20 +47,28 @@ public class FrameworkAccessControlProxy implements CmAccessControl, HasAccessMo
private AccessModelInterpreter interpreter;
private CmAccessControl frameworkAccessControl;
private AccessModel accessModel;
+ private IEventListener listener;
public void setAccessModelInterpreter(AccessModelInterpreter interpreter) {
this.interpreter = interpreter;
}
public void start() {
- OseeDslProvider frameworkDslProvider = new FrameworkDslProvider("osee:/xtext/framework.access.osee");
+ FrameworkDslProvider frameworkDslProvider = new FrameworkDslProvider("osee:/xtext/framework.access.osee");
RoleContextProvider roleProvider = new OseeDslRoleContextProvider(frameworkDslProvider);
accessModel = new OseeDslAccessModel(interpreter, frameworkDslProvider);
frameworkAccessControl = new FrameworkAccessControl(roleProvider);
+
+ listener = new DslUpdateListener(frameworkDslProvider);
+ OseeEventManager.addListener(listener);
}
public void stop() {
+ if (listener != null) {
+ OseeEventManager.removeListener(listener);
+ listener = null;
+ }
frameworkAccessControl = null;
accessModel = null;
}
@@ -71,4 +94,37 @@ public class FrameworkAccessControlProxy implements CmAccessControl, HasAccessMo
return frameworkAccessControl.getContextId(user, object);
}
+ private final class DslUpdateListener implements IArtifactEventListener {
+
+ private List<? extends IEventFilter> eventFilters;
+ private final FrameworkDslProvider dslProvider;
+
+ public DslUpdateListener(FrameworkDslProvider dslProvider) {
+ this.dslProvider = dslProvider;
+ }
+
+ @Override
+ public synchronized List<? extends IEventFilter> getEventFilters() {
+ if (eventFilters == null) {
+ Artifact artifact = dslProvider.getStorageArtifact();
+ if (artifact != null) {
+ eventFilters = Arrays.asList(new ArtifactEventFilter(artifact));
+ } else {
+ eventFilters =
+ Arrays.asList(new ArtifactTypeEventFilter(CoreArtifactTypes.AccessControlModel),
+ new BranchGuidEventFilter(CoreBranches.COMMON));
+ }
+ }
+ return eventFilters;
+ }
+
+ @Override
+ public void handleArtifactEvent(ArtifactEvent artifactEvent, Sender sender) {
+ try {
+ dslProvider.loadDsl();
+ } catch (OseeCoreException ex) {
+ OseeLog.log(DefaultFrameworkAccessConstants.class, Level.SEVERE, ex);
+ }
+ }
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.access.provider/src/org/eclipse/osee/framework/access/provider/internal/FrameworkDslProvider.java b/plugins/org.eclipse.osee.framework.access.provider/src/org/eclipse/osee/framework/access/provider/internal/FrameworkDslProvider.java
index fa1d072198..983c3c03b3 100644
--- a/plugins/org.eclipse.osee.framework.access.provider/src/org/eclipse/osee/framework/access/provider/internal/FrameworkDslProvider.java
+++ b/plugins/org.eclipse.osee.framework.access.provider/src/org/eclipse/osee/framework/access/provider/internal/FrameworkDslProvider.java
@@ -10,24 +10,14 @@
*******************************************************************************/
package org.eclipse.osee.framework.access.provider.internal;
-import java.util.Arrays;
-import java.util.List;
-import java.util.logging.Level;
import org.eclipse.osee.framework.core.dsl.ui.integration.operations.AbstractOseeDslProvider;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Strings;
-import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
-import org.eclipse.osee.framework.skynet.core.event.OseeEventManager;
-import org.eclipse.osee.framework.skynet.core.event.filter.ArtifactEventFilter;
-import org.eclipse.osee.framework.skynet.core.event.filter.IEventFilter;
-import org.eclipse.osee.framework.skynet.core.event.listener.IArtifactEventListener;
-import org.eclipse.osee.framework.skynet.core.event.model.ArtifactEvent;
-import org.eclipse.osee.framework.skynet.core.event.model.Sender;
/**
* @author John Misinco
@@ -36,31 +26,12 @@ public class FrameworkDslProvider extends AbstractOseeDslProvider {
public FrameworkDslProvider(String locationUri) {
super(locationUri);
- OseeEventManager.addListener(new IArtifactEventListener() {
-
- private final List<? extends IEventFilter> filter =
- Arrays.asList(new ArtifactEventFilter(getStorageArtifact()));
-
- @Override
- public List<? extends IEventFilter> getEventFilters() {
- return filter;
- }
-
- @Override
- public void handleArtifactEvent(ArtifactEvent artifactEvent, Sender sender) {
- try {
- loadDsl();
- } catch (OseeCoreException ex) {
- OseeLog.log(FrameworkDslProvider.class, Level.SEVERE, ex);
- }
- }
- });
}
- private Artifact getStorageArtifact() {
+ protected Artifact getStorageArtifact() {
try {
return ArtifactQuery.getArtifactFromTypeAndName(CoreArtifactTypes.AccessControlModel,
- DefaultFrameworkAccessContstants.STORAGE_ARTIFACT_NAME, BranchManager.getCommonBranch());
+ DefaultFrameworkAccessConstants.STORAGE_ARTIFACT_NAME, BranchManager.getCommonBranch());
} catch (OseeCoreException ex) {
return null;
}
diff --git a/plugins/org.eclipse.osee.framework.access.provider/src/org/eclipse/osee/framework/access/provider/internal/config/FrameworkAccessConfig.java b/plugins/org.eclipse.osee.framework.access.provider/src/org/eclipse/osee/framework/access/provider/internal/config/FrameworkAccessConfig.java
index 2cef0363e5..f698040b09 100644
--- a/plugins/org.eclipse.osee.framework.access.provider/src/org/eclipse/osee/framework/access/provider/internal/config/FrameworkAccessConfig.java
+++ b/plugins/org.eclipse.osee.framework.access.provider/src/org/eclipse/osee/framework/access/provider/internal/config/FrameworkAccessConfig.java
@@ -14,7 +14,7 @@ import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
-import org.eclipse.osee.framework.access.provider.internal.DefaultFrameworkAccessContstants;
+import org.eclipse.osee.framework.access.provider.internal.DefaultFrameworkAccessConstants;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.CoreBranches;
@@ -49,7 +49,7 @@ public class FrameworkAccessConfig implements IDbInitializationTask {
SkynetTransaction transaction =
TransactionManager.createTransaction(CoreBranches.COMMON, "Add Framework Access Model");
Artifact artifact = ArtifactTypeManager.addArtifact(CoreArtifactTypes.AccessControlModel, CoreBranches.COMMON);
- artifact.setName(DefaultFrameworkAccessContstants.STORAGE_ARTIFACT_NAME);
+ artifact.setName(DefaultFrameworkAccessConstants.STORAGE_ARTIFACT_NAME);
artifact.setSoleAttributeFromStream(CoreAttributeTypes.GeneralStringData, inputStream);
artifact.persist(transaction);
diff --git a/plugins/org.eclipse.osee.framework.access/OSGI-INF/access.control.service.xml b/plugins/org.eclipse.osee.framework.access/OSGI-INF/access.control.service.xml
index d14d548d0e..8ac54f9891 100644
--- a/plugins/org.eclipse.osee.framework.access/OSGI-INF/access.control.service.xml
+++ b/plugins/org.eclipse.osee.framework.access/OSGI-INF/access.control.service.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="start" deactivate="stop" immediate="true" name="org.eclipse.osee.framework.access.internal.AccessControlServiceProxy">
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="start" deactivate="stop" name="org.eclipse.osee.framework.access.internal.AccessControlServiceProxy">
<implementation class="org.eclipse.osee.framework.access.internal.AccessControlServiceProxy"/>
<service>
<provide interface="org.eclipse.osee.framework.core.services.IAccessControlService"/>
diff --git a/plugins/org.eclipse.osee.framework.access/OSGI-INF/access.provider.admin.xml b/plugins/org.eclipse.osee.framework.access/OSGI-INF/access.provider.admin.xml
index 65e1f75f07..06e89668c4 100644
--- a/plugins/org.eclipse.osee.framework.access/OSGI-INF/access.provider.admin.xml
+++ b/plugins/org.eclipse.osee.framework.access/OSGI-INF/access.provider.admin.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true" activate="start" deactivate="stop" name="org.eclipse.osee.framework.access.internal.AccessProviderAdmin">
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="start" deactivate="stop" name="org.eclipse.osee.framework.access.internal.AccessProviderAdmin">
<implementation class="org.eclipse.osee.framework.access.internal.AccessProviderAdmin"/>
<reference bind="setLifecycleService" cardinality="1..1" interface="org.eclipse.osee.framework.lifecycle.ILifecycleService" name="ILifecycleService" policy="static"/>
<reference bind="addAccessProvider" cardinality="1..n" interface="org.eclipse.osee.framework.access.IAccessProvider" name="IAccessProvider" policy="dynamic" unbind="removeAccessProvider"/>
diff --git a/plugins/org.eclipse.osee.framework.access/build.properties b/plugins/org.eclipse.osee.framework.access/build.properties
index d8b631f26a..6210e849b5 100644
--- a/plugins/org.eclipse.osee.framework.access/build.properties
+++ b/plugins/org.eclipse.osee.framework.access/build.properties
@@ -1,6 +1,5 @@
output.. = bin/
bin.includes = META-INF/,\
.,\
- OSGI-INF/,\
- OSGI-INF/static.access.control.helper.xml .xml
+ OSGI-INF/
source.. = src/
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration/OSGI-INF/osee.dsl.modeling.service.xml b/plugins/org.eclipse.osee.framework.core.dsl.integration/OSGI-INF/osee.dsl.modeling.service.xml
index 1d8c7ff0dc..fb895a817d 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.integration/OSGI-INF/osee.dsl.modeling.service.xml
+++ b/plugins/org.eclipse.osee.framework.core.dsl.integration/OSGI-INF/osee.dsl.modeling.service.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="start" name="org.eclipse.osee.framework.core.dsl.integration.internal.OseeModelingServiceImpl">
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="start" deactivate="stop" name="org.eclipse.osee.framework.core.dsl.integration.internal.OseeModelingServiceImpl">
<implementation class="org.eclipse.osee.framework.core.dsl.integration.internal.OseeModelingServiceImpl"/>
<service>
<provide interface="org.eclipse.osee.framework.core.services.IOseeModelingService"/>
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/OSGI-INF/access.policy.service.xml b/plugins/org.eclipse.osee.framework.skynet.core/OSGI-INF/access.policy.service.xml
index bef9f3bfb2..933463eda6 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/OSGI-INF/access.policy.service.xml
+++ b/plugins/org.eclipse.osee.framework.skynet.core/OSGI-INF/access.policy.service.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true" name="org.eclipse.osee.framework.skynet.core.internal.AccessPolicyImpl">
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.osee.framework.skynet.core.internal.AccessPolicyImpl">
<implementation class="org.eclipse.osee.framework.skynet.core.internal.AccessPolicyImpl"/>
<service>
<provide interface="org.eclipse.osee.framework.skynet.core.AccessPolicy"/>

Back to the top