* @param sessionID the session ID to use.
*/
@SuppressWarnings("unchecked")
private void createSessionServices(SessionData sd, String sessionID) {
RepositoryAdminImpl rai = new RepositoryAdminImpl(sessionID);
Component comp1 = createComponent()
.setInterface(RepositoryAdmin.class.getName(), rai.getSessionProps())
.setImplementation(rai)
.setComposition("getInstances")
.add(createServiceDependency().setService(PreferencesService.class).setRequired(true))
.add(createServiceDependency().setService(EventAdmin.class).setRequired(true))
.add(createServiceDependency().setService(LogService.class).setRequired(false));
String sessionFilter = "(" + SessionFactory.SERVICE_SID + "=" + sessionID + ")";
String auditLogFilter = "(&(" + Constants.OBJECTCLASS + "=" + LogStore.class.getName() + ")(name=auditlog))";
Dictionary topic = new Hashtable();
topic.put(SessionFactory.SERVICE_SID, sessionID);
topic.put(EventConstants.EVENT_FILTER, sessionFilter);
topic.put(EventConstants.EVENT_TOPIC, new String[] {
ArtifactObject.TOPIC_ALL,
Artifact2FeatureAssociation.TOPIC_ALL,
FeatureObject.TOPIC_ALL,
Feature2DistributionAssociation.TOPIC_ALL,
DistributionObject.TOPIC_ALL,
Distribution2TargetAssociation.TOPIC_ALL,
TargetObject.TOPIC_ALL,
DeploymentVersionObject.TOPIC_ALL,
RepositoryAdmin.TOPIC_REFRESH,
RepositoryAdmin.TOPIC_LOGIN
});
StatefulTargetRepositoryImpl statefulTargetRepositoryImpl = new StatefulTargetRepositoryImpl(sessionID);
Component comp2 = createComponent()
.setInterface(new String[] { StatefulTargetRepository.class.getName(), EventHandler.class.getName() }, topic)
.setImplementation(statefulTargetRepositoryImpl)
.add(createServiceDependency().setService(ArtifactRepository.class, sessionFilter).setRequired(true))
.add(createServiceDependency().setService(TargetRepository.class, sessionFilter).setRequired(true))
.add(createServiceDependency().setService(DeploymentVersionRepository.class, sessionFilter).setRequired(true))