1 package org
.argeo
.cms
.internal
.runtime
;
3 import org
.argeo
.api
.cms
.CmsDeployment
;
4 import org
.argeo
.api
.cms
.CmsLog
;
5 import org
.argeo
.api
.cms
.CmsState
;
6 import org
.osgi
.service
.http
.HttpService
;
8 /** Implementation of a CMS deployment. */
9 public class CmsDeploymentImpl
implements CmsDeployment
{
10 private final CmsLog log
= CmsLog
.getLog(getClass());
13 private boolean httpExpected
= false;
14 private HttpService httpService
;
16 private CmsState cmsState
;
17 // private DeployConfig deployConfig;
20 // httpExpected = deployConfig.getProps(KernelConstants.JETTY_FACTORY_PID, "default") != null;
21 // if (deployConfig.hasDomain()) {
22 // loadIpaJaasConfiguration();
25 log
.debug(() -> "CMS deployment available");
28 // public void addFactoryDeployConfig(String factoryPid, Dictionary<String, Object> props) {
29 // deployConfig.putFactoryDeployConfig(factoryPid, props);
30 // deployConfig.save();
32 // deployConfig.loadConfigs();
33 // } catch (IOException e) {
34 // throw new IllegalStateException(e);
38 // public Dictionary<String, Object> getProps(String factoryPid, String cn) {
39 // return deployConfig.getProps(factoryPid, cn);
42 public boolean isHttpAvailableOrNotExpected() {
43 return (httpExpected ? httpService
!= null : true);
46 // private void loadIpaJaasConfiguration() {
47 // if (System.getProperty(KernelConstants.JAAS_CONFIG_PROP) == null) {
48 // String jaasConfig = KernelConstants.JAAS_CONFIG_IPA;
49 // URL url = getClass().getClassLoader().getResource(jaasConfig);
50 // KernelUtils.setJaasConfiguration(url);
51 // log.debug("Set IPA JAAS configuration.");
56 // if (deployConfig != null) {
57 // deployConfig.save();
61 // public void setDeployConfig(DeployConfig deployConfig) {
62 // this.deployConfig = deployConfig;
65 public void setCmsState(CmsState cmsState
) {
66 this.cmsState
= cmsState
;
67 String httpPort
= this.cmsState
.getDeployProperty("org.osgi.service.http.port");
68 String httpsPort
= this.cmsState
.getDeployProperty("org.osgi.service.http.port.secure");
69 httpExpected
= httpPort
!= null || httpsPort
!= null;
72 public void setHttpService(HttpService httpService
) {
73 this.httpService
= httpService
;