forked from community/device-mgt-plugins
parent
737b90ce40
commit
f22b6251c1
@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
||||
* Version 2.0 (the "License"); you may not use this file except
|
||||
* in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.wso2.carbon.device.mgt.iot.service;
|
||||
|
||||
import org.wso2.carbon.device.mgt.iot.config.server.datasource.ControlQueue;
|
||||
import org.wso2.carbon.device.mgt.iot.config.server.datasource.DeviceManagementConfiguration;
|
||||
import org.wso2.carbon.device.mgt.iot.config.server.datasource.DeviceMgtServerInfo;
|
||||
|
||||
public interface ConfigurationService {
|
||||
|
||||
|
||||
/**
|
||||
* Retrieve all configurations in devicemgt-config.xml
|
||||
*
|
||||
* @return Complete set of configurations
|
||||
*/
|
||||
DeviceManagementConfiguration getDeviceCloudMgtConfig();
|
||||
|
||||
|
||||
/**
|
||||
* Retrieve control queue configurations
|
||||
*
|
||||
* @param name of the control queue
|
||||
* @return control queue configs
|
||||
*/
|
||||
ControlQueue getControlQueue(String name);
|
||||
|
||||
|
||||
/**
|
||||
* Retrieve device management server information
|
||||
*
|
||||
* @return device management server information
|
||||
*/
|
||||
DeviceMgtServerInfo getDeviceManagementServerInfo();
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
||||
* Version 2.0 (the "License"); you may not use this file except
|
||||
* in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.wso2.carbon.device.mgt.iot.service;
|
||||
|
||||
import org.wso2.carbon.device.mgt.iot.config.server.datasource.ControlQueue;
|
||||
import org.wso2.carbon.device.mgt.iot.config.server.datasource.DeviceManagementConfiguration;
|
||||
import org.wso2.carbon.device.mgt.iot.config.server.datasource.DeviceMgtServerInfo;
|
||||
|
||||
public class ConfigurationServiceImpl implements ConfigurationService {
|
||||
|
||||
@Override
|
||||
public DeviceManagementConfiguration getDeviceCloudMgtConfig() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ControlQueue getControlQueue(String name) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceMgtServerInfo getDeviceManagementServerInfo() {
|
||||
return null;
|
||||
}
|
||||
}
|
@ -1,60 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
||||
* Version 2.0 (the "License"); you may not use this file except
|
||||
* in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.wso2.carbon.device.mgt.iot.startup;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.wso2.carbon.core.ServerStartupObserver;
|
||||
import org.wso2.carbon.device.mgt.iot.internal.IotDeviceManagementServiceComponent;
|
||||
import org.wso2.carbon.utils.CarbonUtils;
|
||||
import org.wso2.carbon.utils.ConfigurationContextService;
|
||||
import org.wso2.carbon.utils.NetworkUtils;
|
||||
|
||||
public class StartupUrlPrinter implements ServerStartupObserver {
|
||||
private static final Log log = LogFactory.getLog(StartupUrlPrinter.class);
|
||||
@Override
|
||||
public void completingServerStartup() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void completedServerStartup() {
|
||||
printUrl();
|
||||
|
||||
|
||||
}
|
||||
private void printUrl() {
|
||||
// Hostname
|
||||
String hostName = "localhost";
|
||||
try {
|
||||
hostName = NetworkUtils.getMgtHostName();
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
// HTTPS port
|
||||
String mgtConsoleTransport = CarbonUtils.getManagementTransport();
|
||||
ConfigurationContextService configContextService = IotDeviceManagementServiceComponent.configurationContextService;
|
||||
|
||||
int httpsPort = CarbonUtils.getTransportPort(configContextService, mgtConsoleTransport);
|
||||
|
||||
log.info("Api Store: https://" + hostName + ":" + httpsPort + "/api-store");
|
||||
log.info("IOT Server - Device Store: https://" + hostName + ":" + httpsPort + "/store");
|
||||
log.info("IOT Server - Device Publisher: https://" + hostName + ":" + httpsPort + "/publisher");
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in new issue