Fix merge conflixts

This commit is contained in:
lasanthaDLPDS 2018-08-19 15:06:25 +05:30
commit d293b5b1b8
479 changed files with 20703 additions and 3435 deletions

15
.github/stale.yml vendored Normal file
View File

@ -0,0 +1,15 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 10
# Don't close isssues or pulls
daysUntilClose: false
# Issues with these labels will never be considered stale
exemptLabels:
- Resolution/Postponed
# Label to use when marking an issue as stale
staleLabel: Resolution/Stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false

View File

@ -22,13 +22,13 @@
<parent> <parent>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.217-SNAPSHOT</version> <version>3.1.34-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.apimgt.annotations</artifactId> <artifactId>org.wso2.carbon.apimgt.annotations</artifactId>
<version>3.0.217-SNAPSHOT</version> <version>3.1.34-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - API Management Annotations</name> <name>WSO2 Carbon - API Management Annotations</name>
<description>WSO2 Carbon - API Management Custom Annotation Module</description> <description>WSO2 Carbon - API Management Custom Annotation Module</description>

View File

@ -21,12 +21,12 @@
<parent> <parent>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.217-SNAPSHOT</version> <version>3.1.34-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<version>3.0.217-SNAPSHOT</version> <version>3.1.34-SNAPSHOT</version>
<artifactId>org.wso2.carbon.apimgt.application.extension.api</artifactId> <artifactId>org.wso2.carbon.apimgt.application.extension.api</artifactId>
<packaging>war</packaging> <packaging>war</packaging>
<name>WSO2 Carbon - API Application Management API</name> <name>WSO2 Carbon - API Application Management API</name>

View File

@ -22,12 +22,12 @@
<parent> <parent>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.217-SNAPSHOT</version> <version>3.1.34-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<version>3.0.217-SNAPSHOT</version> <version>3.1.34-SNAPSHOT</version>
<artifactId>org.wso2.carbon.apimgt.application.extension</artifactId> <artifactId>org.wso2.carbon.apimgt.application.extension</artifactId>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - API Application Management</name> <name>WSO2 Carbon - API Application Management</name>

View File

@ -129,6 +129,7 @@ public class APIManagementProviderServiceImpl implements APIManagementProviderSe
for (APIInfo apiInfo : apiList.getList()) { for (APIInfo apiInfo : apiList.getList()) {
String id = apiInfo.getProvider().replace("@", "-AT-") String id = apiInfo.getProvider().replace("@", "-AT-")
+ "-" + apiInfo.getName() + "-" + apiInfo.getVersion(); + "-" + apiInfo.getName() + "-" + apiInfo.getVersion();
id = id.replace(" ", "+");
boolean subscriptionExist = false; boolean subscriptionExist = false;
if (subscriptionList.getList() != null && subscriptionList.getList().size() > 0) { if (subscriptionList.getList() != null && subscriptionList.getList().size() > 0) {
for (Subscription subs : subscriptionList.getList()) { for (Subscription subs : subscriptionList.getList()) {

View File

@ -21,13 +21,13 @@
<parent> <parent>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.217-SNAPSHOT</version> <version>3.1.34-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.apimgt.handlers</artifactId> <artifactId>org.wso2.carbon.apimgt.handlers</artifactId>
<version>3.0.217-SNAPSHOT</version> <version>3.1.34-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - API Security Handler Component</name> <name>WSO2 Carbon - API Security Handler Component</name>
<description>WSO2 Carbon - API Management Security Handler Module</description> <description>WSO2 Carbon - API Management Security Handler Module</description>

View File

@ -29,7 +29,7 @@
<Password>admin</Password> <Password>admin</Password>
<!--Dynamic client registration endpoint--> <!--Dynamic client registration endpoint-->
<DynamicClientRegistrationEndpoint>https://${iot.keymanager.host}:${iot.keymanager.https.port}/client-registration/v0.11/register</DynamicClientRegistrationEndpoint> <DynamicClientRegistrationEndpoint>https://${iot.keymanager.host}:${iot.keymanager.https.port}/client-registration/v0.12/register</DynamicClientRegistrationEndpoint>
<!--Oauth token endpoint--> <!--Oauth token endpoint-->
<OauthTokenEndpoint>https://${iot.keymanager.host}:${iot.keymanager.https.port}/oauth2/token</OauthTokenEndpoint> <OauthTokenEndpoint>https://${iot.keymanager.host}:${iot.keymanager.https.port}/oauth2/token</OauthTokenEndpoint>

View File

@ -47,7 +47,7 @@ public class IOTServerConfigurationTest extends BaseAPIHandlerTest {
Assert.assertEquals(serverConfiguration.getUsername(), "testuser"); Assert.assertEquals(serverConfiguration.getUsername(), "testuser");
Assert.assertEquals(serverConfiguration.getPassword(), "testuserpwd"); Assert.assertEquals(serverConfiguration.getPassword(), "testuserpwd");
Assert.assertEquals(serverConfiguration.getDynamicClientRegistrationEndpoint(), Assert.assertEquals(serverConfiguration.getDynamicClientRegistrationEndpoint(),
"https://${iot.keymanager.host}:${iot.keymanager.https.port}/client-registration/v0.11/register"); "https://${iot.keymanager.host}:${iot.keymanager.https.port}/client-registration/v0.12/register");
Assert.assertEquals(serverConfiguration.getOauthTokenEndpoint(), Assert.assertEquals(serverConfiguration.getOauthTokenEndpoint(),
"https://${iot.keymanager.host}:${iot.keymanager.https.port}/oauth2/token"); "https://${iot.keymanager.host}:${iot.keymanager.https.port}/oauth2/token");
Assert.assertEquals(serverConfiguration.getApis().size(), 1); Assert.assertEquals(serverConfiguration.getApis().size(), 1);
@ -87,7 +87,7 @@ public class IOTServerConfigurationTest extends BaseAPIHandlerTest {
Assert.assertEquals(serverConfiguration.getPassword(), "testuserpwd"); Assert.assertEquals(serverConfiguration.getPassword(), "testuserpwd");
Assert.assertEquals(serverConfiguration.getDynamicClientRegistrationEndpoint(), Assert.assertEquals(serverConfiguration.getDynamicClientRegistrationEndpoint(),
"https://" + TestUtils.IOT_KEYMANAGER_HOST + ":" + TestUtils.IOT_KEYMANAGER_PORT "https://" + TestUtils.IOT_KEYMANAGER_HOST + ":" + TestUtils.IOT_KEYMANAGER_PORT
+ "/client-registration/v0.11/register"); + "/client-registration/v0.12/register");
Assert.assertEquals(serverConfiguration.getOauthTokenEndpoint(), Assert.assertEquals(serverConfiguration.getOauthTokenEndpoint(),
"https://" + TestUtils.IOT_KEYMANAGER_HOST + ":" + TestUtils.IOT_KEYMANAGER_PORT "https://" + TestUtils.IOT_KEYMANAGER_HOST + ":" + TestUtils.IOT_KEYMANAGER_PORT
+ "/oauth2/token"); + "/oauth2/token");

View File

@ -29,7 +29,7 @@
<Password>testuserpwd</Password> <Password>testuserpwd</Password>
<!--Dynamic client registration endpoint--> <!--Dynamic client registration endpoint-->
<DynamicClientRegistrationEndpoint>https://${iot.keymanager.host}:${iot.keymanager.https.port}/client-registration/v0.11/register</DynamicClientRegistrationEndpoint> <DynamicClientRegistrationEndpoint>https://${iot.keymanager.host}:${iot.keymanager.https.port}/client-registration/v0.12/register</DynamicClientRegistrationEndpoint>
<!--Oauth token endpoint--> <!--Oauth token endpoint-->
<OauthTokenEndpoint>https://${iot.keymanager.host}:${iot.keymanager.https.port}/oauth2/token</OauthTokenEndpoint> <OauthTokenEndpoint>https://${iot.keymanager.host}:${iot.keymanager.https.port}/oauth2/token</OauthTokenEndpoint>

View File

@ -29,7 +29,7 @@
<Password>testuserpwd</Password> <Password>testuserpwd</Password>
<!--Dynamic client registration endpoint--> <!--Dynamic client registration endpoint-->
<DynamicClientRegistrationEndpoint>https://${iot.keymanager.host}:${iot.keymanager.https.port}/client-registration/v0.11/register</DynamicClientRegistrationEndpoint> <DynamicClientRegistrationEndpoint>https://${iot.keymanager.host}:${iot.keymanager.https.port}/client-registration/v0.12/register</DynamicClientRegistrationEndpoint>
<!--Oauth token endpoint--> <!--Oauth token endpoint-->
<OauthTokenEndpoint>https://${iot.keymanager.host}:${iot.keymanager.https.port}/oauth2/token</OauthTokenEndpoint> <OauthTokenEndpoint>https://${iot.keymanager.host}:${iot.keymanager.https.port}/oauth2/token</OauthTokenEndpoint>

View File

@ -29,7 +29,7 @@
<Password>testuserpwd</Password> <Password>testuserpwd</Password>
<!--Dynamic client registration endpoint--> <!--Dynamic client registration endpoint-->
<DynamicClientRegistrationEndpoint>https://${iot.keymanager.host}:${iot.keymanager.https.port}/client-registration/v0.11/register</DynamicClientRegistrationEndpoint> <DynamicClientRegistrationEndpoint>https://${iot.keymanager.host}:${iot.keymanager.https.port}/client-registration/v0.12/register</DynamicClientRegistrationEndpoint>
<!--Oauth token endpoint--> <!--Oauth token endpoint-->
<OauthTokenEndpoint>https://${iot.keymanager.host}:${iot.keymanager.https.port}/oauth2/token</OauthTokenEndpoint> <OauthTokenEndpoint>https://${iot.keymanager.host}:${iot.keymanager.https.port}/oauth2/token</OauthTokenEndpoint>

View File

@ -13,13 +13,13 @@
<parent> <parent>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.217-SNAPSHOT</version> <version>3.1.34-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.apimgt.integration.client</artifactId> <artifactId>org.wso2.carbon.apimgt.integration.client</artifactId>
<version>3.0.217-SNAPSHOT</version> <version>3.1.34-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - API Management Integration Client</name> <name>WSO2 Carbon - API Management Integration Client</name>
<description>WSO2 Carbon - API Management Integration Client</description> <description>WSO2 Carbon - API Management Integration Client</description>
@ -72,10 +72,20 @@
javax.xml, javax.xml,
org.wso2.carbon.base, org.wso2.carbon.base,
javax.net.ssl, javax.net.ssl,
org.apache.commons.lang,
android.util;resolution:=optional,
javax.annotation;resolution:=optional,
javax.net;resolution:=optional,
javax.security.auth.x500;resolution:=optional,
javax.crypto;resolution:=optional,
javax.crypto.spec;resolution:=optional
</Import-Package> </Import-Package>
<Embed-Dependency> <Embed-Dependency>
jsr311-api, jsr311-api,
feign-jaxrs feign-jaxrs,
feign-okhttp,
okhttp,
okio
</Embed-Dependency> </Embed-Dependency>
</instructions> </instructions>
</configuration> </configuration>
@ -110,6 +120,18 @@
</build> </build>
<dependencies> <dependencies>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
</dependency>
<dependency>
<groupId>com.squareup.okio</groupId>
<artifactId>okio</artifactId>
</dependency>
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-okhttp</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.wso2.carbon</groupId> <groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.logging</artifactId> <artifactId>org.wso2.carbon.logging</artifactId>

View File

@ -22,6 +22,7 @@ import feign.auth.BasicAuthRequestInterceptor;
import feign.gson.GsonDecoder; import feign.gson.GsonDecoder;
import feign.gson.GsonEncoder; import feign.gson.GsonEncoder;
import feign.jaxrs.JAXRSContract; import feign.jaxrs.JAXRSContract;
import feign.okhttp.OkHttpClient;
import feign.slf4j.Slf4jLogger; import feign.slf4j.Slf4jLogger;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
@ -65,8 +66,9 @@ public class OAuthRequestInterceptor implements RequestInterceptor {
public OAuthRequestInterceptor() { public OAuthRequestInterceptor() {
String username = APIMConfigReader.getInstance().getConfig().getUsername(); String username = APIMConfigReader.getInstance().getConfig().getUsername();
String password = APIMConfigReader.getInstance().getConfig().getPassword(); String password = APIMConfigReader.getInstance().getConfig().getPassword();
dcrClient = Feign.builder().client(Utils.getSSLClient()).logger(new Slf4jLogger()).logLevel( dcrClient = Feign.builder().client(new OkHttpClient(Utils.getSSLClient())).logger(new Slf4jLogger())
Logger.Level.FULL).requestInterceptor(new BasicAuthRequestInterceptor(username, password)) .logLevel(Logger.Level.FULL).requestInterceptor(new BasicAuthRequestInterceptor(username,
password))
.contract(new JAXRSContract()).encoder(new GsonEncoder()).decoder(new GsonDecoder()) .contract(new JAXRSContract()).encoder(new GsonEncoder()).decoder(new GsonDecoder())
.target(DCRClient.class, Utils.replaceProperties( .target(DCRClient.class, Utils.replaceProperties(
APIMConfigReader.getInstance().getConfig().getDcrEndpoint())); APIMConfigReader.getInstance().getConfig().getDcrEndpoint()));

View File

@ -22,6 +22,7 @@ import feign.Logger;
import feign.RequestInterceptor; import feign.RequestInterceptor;
import feign.gson.GsonDecoder; import feign.gson.GsonDecoder;
import feign.gson.GsonEncoder; import feign.gson.GsonEncoder;
import feign.okhttp.OkHttpClient;
import feign.slf4j.Slf4jLogger; import feign.slf4j.Slf4jLogger;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
@ -35,12 +36,13 @@ import org.wso2.carbon.core.util.Utils;
public class PublisherClient { public class PublisherClient {
private static final Log log = LogFactory.getLog(PublisherClient.class); private static final Log log = LogFactory.getLog(PublisherClient.class);
private APIsApi api = null; private APIIndividualApi api = null;
private APIDocumentApi document = null; private APICollectionApi apis = null;
private ApplicationsApi application = null; private DocumentIndividualApi document = null;
private EnvironmentsApi environments = null; private ApplicationIndividualApi application = null;
private SubscriptionsApi subscriptions = null; private EnvironmentCollectionApi environments = null;
private TiersApi tiers = null; private SubscriptionCollectionApi subscriptions = null;
private ThrottlingTierCollectionApi tiers = null;
/** /**
@ -48,41 +50,47 @@ public class PublisherClient {
* *
*/ */
public PublisherClient(RequestInterceptor requestInterceptor) { public PublisherClient(RequestInterceptor requestInterceptor) {
Feign.Builder builder = Feign.builder().client( Feign.Builder builder = Feign.builder().client(new OkHttpClient(
org.wso2.carbon.apimgt.integration.client.util.Utils.getSSLClient()).logger(new Slf4jLogger()) org.wso2.carbon.apimgt.integration.client.util.Utils.getSSLClient())).logger(new
Slf4jLogger())
.logLevel(Logger.Level.FULL) .logLevel(Logger.Level.FULL)
.requestInterceptor(requestInterceptor).encoder(new GsonEncoder()).decoder(new GsonDecoder()); .requestInterceptor(requestInterceptor).encoder(new GsonEncoder()).decoder(new GsonDecoder());
String basePath = Utils.replaceSystemProperty(APIMConfigReader.getInstance().getConfig().getPublisherEndpoint()); String basePath = Utils.replaceSystemProperty(APIMConfigReader.getInstance().getConfig().getPublisherEndpoint());
api = builder.target(APIsApi.class, basePath); api = builder.target(APIIndividualApi.class, basePath);
document = builder.target(APIDocumentApi.class, basePath); apis = builder.target(APICollectionApi.class, basePath);
application = builder.target(ApplicationsApi.class, basePath); document = builder.target(DocumentIndividualApi.class, basePath);
environments = builder.target(EnvironmentsApi.class, basePath); application = builder.target(ApplicationIndividualApi.class, basePath);
subscriptions = builder.target(SubscriptionsApi.class, basePath); environments = builder.target(EnvironmentCollectionApi.class, basePath);
tiers = builder.target(TiersApi.class, basePath); subscriptions = builder.target(SubscriptionCollectionApi.class, basePath);
tiers = builder.target(ThrottlingTierCollectionApi.class, basePath);
} }
public APIsApi getApi() { public APIIndividualApi getApi() {
return api; return api;
} }
public APIDocumentApi getDocument() { public APICollectionApi getApis() {
return apis;
}
public DocumentIndividualApi getDocument() {
return document; return document;
} }
public ApplicationsApi getApplication() { public ApplicationIndividualApi getApplication() {
return application; return application;
} }
public EnvironmentsApi getEnvironments() { public EnvironmentCollectionApi getEnvironments() {
return environments; return environments;
} }
public SubscriptionsApi getSubscriptions() { public SubscriptionCollectionApi getSubscriptions() {
return subscriptions; return subscriptions;
} }
public TiersApi getTiers() { public ThrottlingTierCollectionApi getTiers() {
return tiers; return tiers;
} }
} }

View File

@ -24,6 +24,7 @@ import feign.RequestInterceptor;
import feign.Retryer; import feign.Retryer;
import feign.gson.GsonDecoder; import feign.gson.GsonDecoder;
import feign.gson.GsonEncoder; import feign.gson.GsonEncoder;
import feign.okhttp.OkHttpClient;
import feign.slf4j.Slf4jLogger; import feign.slf4j.Slf4jLogger;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.apimgt.integration.client.configs.APIMConfigReader; import org.wso2.carbon.apimgt.integration.client.configs.APIMConfigReader;
@ -52,8 +53,9 @@ public class StoreClient {
public StoreClient(RequestInterceptor requestInterceptor) { public StoreClient(RequestInterceptor requestInterceptor) {
Feign.Builder builder = Feign.builder().client( Feign.Builder builder = Feign.builder().client(new OkHttpClient(
org.wso2.carbon.apimgt.integration.client.util.Utils.getSSLClient()).logger(new Slf4jLogger()) org.wso2.carbon.apimgt.integration.client.util.Utils.getSSLClient())).logger(new
Slf4jLogger())
.logLevel(Logger.Level.FULL) .logLevel(Logger.Level.FULL)
.requestInterceptor(requestInterceptor).encoder(new GsonEncoder()).decoder(new GsonDecoder()); .requestInterceptor(requestInterceptor).encoder(new GsonEncoder()).decoder(new GsonDecoder());
String basePath = Utils.replaceSystemProperty(APIMConfigReader.getInstance().getConfig().getStoreEndpoint()); String basePath = Utils.replaceSystemProperty(APIMConfigReader.getInstance().getConfig().getStoreEndpoint());

View File

@ -18,25 +18,39 @@
package org.wso2.carbon.apimgt.integration.client.util; package org.wso2.carbon.apimgt.integration.client.util;
import okhttp3.OkHttpClient;
import feign.Client; import org.apache.commons.lang.StringUtils;
import javax.net.ssl.*;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.security.*;
import java.security.cert.CertificateException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import feign.Logger;
import feign.Request;
import feign.Response;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.base.ServerConfiguration; import org.wso2.carbon.base.ServerConfiguration;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import javax.net.ssl.TrustManagerFactory;
import javax.net.ssl.X509TrustManager;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.InetSocketAddress;
import java.net.Proxy;
import java.net.ProxySelector;
import java.net.SocketAddress;
import java.net.URI;
import java.security.KeyManagementException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.UnrecoverableKeyException;
import java.security.cert.CertificateException;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Utils { public class Utils {
private static final Log log = LogFactory.getLog(Utils.class); private static final Log log = LogFactory.getLog(Utils.class);
@ -57,6 +71,10 @@ public class Utils {
private static final String SSLV3 = "SSLv3"; private static final String SSLV3 = "SSLv3";
private static final String DEFAULT_HOST = "localhost";
private static final String DEFAULT_HOST_IP = "127.0.0.1";
//This method is only used if the mb features are within DAS. //This method is only used if the mb features are within DAS.
public static String replaceProperties(String text) { public static String replaceProperties(String text) {
@ -73,17 +91,68 @@ public class Utils {
return text; return text;
} }
public static Client getSSLClient() { public static OkHttpClient getSSLClient() {
boolean isIgnoreHostnameVerification = Boolean.parseBoolean(System.getProperty("org.wso2.ignoreHostnameVerification"));
boolean isIgnoreHostnameVerification = Boolean.parseBoolean(System.getProperty("org.wso2"
+ ".ignoreHostnameVerification"));
OkHttpClient okHttpClient;
final String proxyHost = System.getProperty("http.proxyHost");
final String proxyPort = System.getProperty("http.proxyPort");
final String nonProxyHostsValue = System.getProperty("http.nonProxyHosts");
final ProxySelector proxySelector = new ProxySelector() {
@Override
public java.util.List<Proxy> select(URI uri) {
List<Proxy> proxyList = new ArrayList<>();
String host = uri.getHost();
if (!StringUtils.isEmpty(host)) {
if (host.startsWith(DEFAULT_HOST_IP) || host.startsWith(DEFAULT_HOST) || StringUtils
.isEmpty(nonProxyHostsValue) || StringUtils.contains(nonProxyHostsValue, host) ||
StringUtils.isEmpty(proxyHost) || StringUtils.isEmpty(proxyPort)) {
proxyList.add(Proxy.NO_PROXY);
} else {
proxyList.add(new Proxy(Proxy.Type.HTTP,
new InetSocketAddress(proxyHost, Integer.parseInt(proxyPort))));
}
} else {
log.error("Host is null. Host could not be empty or null");
}
return proxyList;
}
@Override
public void connectFailed(URI uri, SocketAddress sa, IOException ioe) {
throw new UnsupportedOperationException("Not supported yet.");
}
};
X509TrustManager trustAllCerts = new X509TrustManager() {
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return new java.security.cert.X509Certificate[0];
}
public void checkClientTrusted(
java.security.cert.X509Certificate[] certs, String authType) {
}
public void checkServerTrusted(
java.security.cert.X509Certificate[] certs, String authType) {
}
};
if(isIgnoreHostnameVerification) { if(isIgnoreHostnameVerification) {
return new Client.Default(getSimpleTrustedSSLSocketFactory(), new HostnameVerifier() { okHttpClient = new OkHttpClient.Builder()
.sslSocketFactory(getSimpleTrustedSSLSocketFactory(), trustAllCerts)
.hostnameVerifier(new HostnameVerifier() {
@Override @Override
public boolean verify(String s, SSLSession sslSession) { public boolean verify(String s, SSLSession sslSession) {
return true; return true;
} }
}); }).proxySelector(proxySelector).build();
return okHttpClient;
}else { }else {
return new Client.Default(getTrustedSSLSocketFactory(), null); SSLSocketFactory trustedSSLSocketFactory = getTrustedSSLSocketFactory();
okHttpClient = new OkHttpClient.Builder().sslSocketFactory(trustedSSLSocketFactory)
.proxySelector(proxySelector).build();
return okHttpClient;
} }
} }

View File

@ -13,13 +13,13 @@
<parent> <parent>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.217-SNAPSHOT</version> <version>3.1.34-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.apimgt.integration.generated.client</artifactId> <artifactId>org.wso2.carbon.apimgt.integration.generated.client</artifactId>
<version>3.0.217-SNAPSHOT</version> <version>3.1.34-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - API Management Integration Generated Client</name> <name>WSO2 Carbon - API Management Integration Generated Client</name>
<description>WSO2 Carbon - API Management Integration Client</description> <description>WSO2 Carbon - API Management Integration Client</description>

View File

@ -22,13 +22,13 @@
<parent> <parent>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.217-SNAPSHOT</version> <version>3.1.34-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.apimgt.webapp.publisher</artifactId> <artifactId>org.wso2.carbon.apimgt.webapp.publisher</artifactId>
<version>3.0.217-SNAPSHOT</version> <version>3.1.34-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - API Management Webapp Publisher</name> <name>WSO2 Carbon - API Management Webapp Publisher</name>
<description>WSO2 Carbon - API Management Webapp Publisher</description> <description>WSO2 Carbon - API Management Webapp Publisher</description>

View File

@ -50,10 +50,10 @@ public class APIPublisherServiceImpl implements APIPublisherService {
PublisherClient publisherClient = APIPublisherDataHolder.getInstance().getIntegrationClientService() PublisherClient publisherClient = APIPublisherDataHolder.getInstance().getIntegrationClientService()
.getPublisherClient(); .getPublisherClient();
API api = getAPI(apiConfig); API api = getAPI(apiConfig);
APIList apiList = publisherClient.getApi().apisGet(100, 0, "name:" + api.getName(), CONTENT_TYPE, null); APIList apiList = publisherClient.getApis().apisGet(100, 0, "name:" + api.getName(), CONTENT_TYPE, null);
if (!isExist(api, apiList)) { if (!isExist(api, apiList)) {
api = publisherClient.getApi().apisPost(api, CONTENT_TYPE); api = publisherClient.getApi().apisPost(api, CONTENT_TYPE, null);
if (CREATED_STATUS.equals(api.getStatus())) { if (CREATED_STATUS.equals(api.getStatus())) {
publisherClient.getApi().apisChangeLifecyclePost(PUBLISH_ACTION, api.getId(), null, null, null); publisherClient.getApi().apisChangeLifecyclePost(PUBLISH_ACTION, api.getId(), null, null, null);
} }

View File

@ -27,7 +27,8 @@ import org.wso2.carbon.apimgt.integration.client.OAuthRequestInterceptor;
import org.wso2.carbon.apimgt.integration.client.model.OAuthApplication; import org.wso2.carbon.apimgt.integration.client.model.OAuthApplication;
import org.wso2.carbon.apimgt.integration.client.publisher.PublisherClient; import org.wso2.carbon.apimgt.integration.client.publisher.PublisherClient;
import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService; import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService;
import org.wso2.carbon.apimgt.integration.generated.client.publisher.api.APIsApi; import org.wso2.carbon.apimgt.integration.generated.client.publisher.api.APICollectionApi;
import org.wso2.carbon.apimgt.integration.generated.client.publisher.api.APIIndividualApi;
import org.wso2.carbon.apimgt.integration.generated.client.publisher.model.API; import org.wso2.carbon.apimgt.integration.generated.client.publisher.model.API;
import org.wso2.carbon.apimgt.integration.generated.client.publisher.model.APIInfo; import org.wso2.carbon.apimgt.integration.generated.client.publisher.model.APIInfo;
import org.wso2.carbon.apimgt.integration.generated.client.publisher.model.APIList; import org.wso2.carbon.apimgt.integration.generated.client.publisher.model.APIList;
@ -35,7 +36,8 @@ import org.wso2.carbon.apimgt.webapp.publisher.config.WebappPublisherConfig;
import org.wso2.carbon.apimgt.webapp.publisher.dto.ApiScope; import org.wso2.carbon.apimgt.webapp.publisher.dto.ApiScope;
import org.wso2.carbon.apimgt.webapp.publisher.exception.APIManagerPublisherException; import org.wso2.carbon.apimgt.webapp.publisher.exception.APIManagerPublisherException;
import org.wso2.carbon.apimgt.webapp.publisher.internal.APIPublisherDataHolder; import org.wso2.carbon.apimgt.webapp.publisher.internal.APIPublisherDataHolder;
import org.wso2.carbon.apimgt.webapp.publisher.utils.MockApi; import org.wso2.carbon.apimgt.webapp.publisher.utils.MockAPICollectionApi;
import org.wso2.carbon.apimgt.webapp.publisher.utils.MockAPIIndividualApi;
import org.wso2.carbon.apimgt.webapp.publisher.utils.TestUtils; import org.wso2.carbon.apimgt.webapp.publisher.utils.TestUtils;
import java.lang.reflect.Field; import java.lang.reflect.Field;
@ -61,6 +63,12 @@ public class APIPublisherServiceTest extends BaseAPIPublisherTest {
APIManagerPublisherException { APIManagerPublisherException {
APIConfig apiConfig = new APIConfig(); APIConfig apiConfig = new APIConfig();
setApiConfigs(apiConfig, "testAPI-0"); setApiConfigs(apiConfig, "testAPI-0");
PublisherClient publisherClient = APIPublisherDataHolder.getInstance().getIntegrationClientService().
getPublisherClient();
APICollectionApi collectionApi = Mockito.mock(MockAPICollectionApi.class, Mockito.CALLS_REAL_METHODS);
APIIndividualApi apIsApi = Mockito.mock(MockAPIIndividualApi.class, Mockito.CALLS_REAL_METHODS);
doReturn(collectionApi).when(publisherClient).getApis();
doReturn(apIsApi).when(publisherClient).getApi();
apiPublisherService.publishAPI(apiConfig); apiPublisherService.publishAPI(apiConfig);
} }
@ -77,11 +85,13 @@ public class APIPublisherServiceTest extends BaseAPIPublisherTest {
PublisherClient publisherClient = APIPublisherDataHolder.getInstance().getIntegrationClientService(). PublisherClient publisherClient = APIPublisherDataHolder.getInstance().getIntegrationClientService().
getPublisherClient(); getPublisherClient();
doReturn(publisherClient).when(integrationClientService).getPublisherClient(); doReturn(publisherClient).when(integrationClientService).getPublisherClient();
APIsApi apIsApi = Mockito.mock(MockApi.class, Mockito.CALLS_REAL_METHODS); APIIndividualApi apIsApi = Mockito.mock(MockAPIIndividualApi.class, Mockito.CALLS_REAL_METHODS);
APICollectionApi collectionApi = Mockito.mock(MockAPICollectionApi.class, Mockito.CALLS_REAL_METHODS);
doReturn(collectionApi).when(publisherClient).getApis();
doReturn(apIsApi).when(publisherClient).getApi(); doReturn(apIsApi).when(publisherClient).getApi();
API api = Mockito.mock(API.class, Mockito.CALLS_REAL_METHODS); API api = Mockito.mock(API.class, Mockito.CALLS_REAL_METHODS);
api.setStatus("CREATED"); api.setStatus("CREATED");
doReturn(api).when(apIsApi).apisPost(Mockito.any(), Mockito.anyString()); doReturn(api).when(apIsApi).apisPost(Mockito.any(), Mockito.anyString(), Mockito.anyString());
apiPublisherService.publishAPI(apiConfig); apiPublisherService.publishAPI(apiConfig);
} }
@ -97,18 +107,18 @@ public class APIPublisherServiceTest extends BaseAPIPublisherTest {
PublisherClient publisherClient = APIPublisherDataHolder.getInstance().getIntegrationClientService(). PublisherClient publisherClient = APIPublisherDataHolder.getInstance().getIntegrationClientService().
getPublisherClient(); getPublisherClient();
doReturn(publisherClient).when(integrationClientService).getPublisherClient(); doReturn(publisherClient).when(integrationClientService).getPublisherClient();
APIsApi apIsApi = Mockito.mock(MockApi.class, Mockito.CALLS_REAL_METHODS); APIIndividualApi apIsApi = Mockito.mock(MockAPIIndividualApi.class, Mockito.CALLS_REAL_METHODS);
APICollectionApi collectionApi = Mockito.mock(MockAPICollectionApi.class, Mockito.CALLS_REAL_METHODS);
doReturn(collectionApi).when(publisherClient).getApis();
doReturn(apIsApi).when(publisherClient).getApi(); doReturn(apIsApi).when(publisherClient).getApi();
API api = Mockito.mock(API.class, Mockito.CALLS_REAL_METHODS); API api = Mockito.mock(API.class, Mockito.CALLS_REAL_METHODS);
api.setStatus("CREATED"); api.setStatus("CREATED");
doReturn(api).when(apIsApi).apisPost(Mockito.any(), Mockito.anyString()); doReturn(api).when(apIsApi).apisPost(Mockito.any(), Mockito.anyString(), Mockito.anyString());
APIList apiList = Mockito.mock(APIList.class, Mockito.CALLS_REAL_METHODS); APIList apiList = Mockito.mock(APIList.class, Mockito.CALLS_REAL_METHODS);
APIInfo apiInfo = new APIInfo(); APIInfo apiInfo = new APIInfo();
List<APIInfo> apiInfoList = new ArrayList<>(); List<APIInfo> apiInfoList = new ArrayList<>();
apiInfoList.add(apiInfo); apiInfoList.add(apiInfo);
apiList.list(apiInfoList); apiList.list(apiInfoList);
doReturn(apiList).when(apIsApi).apisGet(Mockito.anyInt(), Mockito.anyInt(),
Mockito.anyString(), Mockito.anyString(), Mockito.anyString());
doReturn(api).when(apIsApi).apisApiIdPut(Mockito.anyString(), Mockito.any(), doReturn(api).when(apIsApi).apisApiIdPut(Mockito.anyString(), Mockito.any(),
Mockito.anyString(), Mockito.anyString(), Mockito.anyString()); Mockito.anyString(), Mockito.anyString(), Mockito.anyString());
apiPublisherService.publishAPI(apiConfig); apiPublisherService.publishAPI(apiConfig);
@ -126,11 +136,13 @@ public class APIPublisherServiceTest extends BaseAPIPublisherTest {
PublisherClient publisherClient = APIPublisherDataHolder.getInstance().getIntegrationClientService(). PublisherClient publisherClient = APIPublisherDataHolder.getInstance().getIntegrationClientService().
getPublisherClient(); getPublisherClient();
doReturn(publisherClient).when(integrationClientService).getPublisherClient(); doReturn(publisherClient).when(integrationClientService).getPublisherClient();
APIsApi apIsApi = Mockito.mock(MockApi.class, Mockito.CALLS_REAL_METHODS); APIIndividualApi apIsApi = Mockito.mock(MockAPIIndividualApi.class, Mockito.CALLS_REAL_METHODS);
APICollectionApi collectionApi = Mockito.mock(MockAPICollectionApi.class, Mockito.CALLS_REAL_METHODS);
doReturn(collectionApi).when(publisherClient).getApis();
doReturn(apIsApi).when(publisherClient).getApi(); doReturn(apIsApi).when(publisherClient).getApi();
API api = Mockito.mock(API.class, Mockito.CALLS_REAL_METHODS); API api = Mockito.mock(API.class, Mockito.CALLS_REAL_METHODS);
api.setStatus("CREATED"); api.setStatus("CREATED");
doReturn(api).when(apIsApi).apisPost(Mockito.any(), Mockito.anyString()); doReturn(api).when(apIsApi).apisPost(Mockito.any(), Mockito.anyString(), Mockito.anyString());
APIList apiList = Mockito.mock(APIList.class, Mockito.CALLS_REAL_METHODS); APIList apiList = Mockito.mock(APIList.class, Mockito.CALLS_REAL_METHODS);
APIInfo apiInfo = new APIInfo(); APIInfo apiInfo = new APIInfo();
apiInfo.setName("testAPI-3"); apiInfo.setName("testAPI-3");
@ -139,8 +151,6 @@ public class APIPublisherServiceTest extends BaseAPIPublisherTest {
List<APIInfo> apiInfoList = new ArrayList<>(); List<APIInfo> apiInfoList = new ArrayList<>();
apiInfoList.add(apiInfo); apiInfoList.add(apiInfo);
apiList.list(apiInfoList); apiList.list(apiInfoList);
doReturn(apiList).when(apIsApi).apisGet(Mockito.anyInt(), Mockito.anyInt(),
Mockito.anyString(), Mockito.anyString(), Mockito.anyString());
doReturn(api).when(apIsApi).apisApiIdPut(Mockito.anyString(), Mockito.any(), doReturn(api).when(apIsApi).apisApiIdPut(Mockito.anyString(), Mockito.any(),
Mockito.anyString(), Mockito.anyString(), Mockito.anyString()); Mockito.anyString(), Mockito.anyString(), Mockito.anyString());
apiConfig.setSharedWithAllTenants(false); apiConfig.setSharedWithAllTenants(false);

View File

@ -26,9 +26,9 @@ import org.wso2.carbon.apimgt.integration.client.IntegrationClientServiceImpl;
import org.wso2.carbon.apimgt.integration.client.internal.APIIntegrationClientDataHolder; import org.wso2.carbon.apimgt.integration.client.internal.APIIntegrationClientDataHolder;
import org.wso2.carbon.apimgt.integration.client.publisher.PublisherClient; import org.wso2.carbon.apimgt.integration.client.publisher.PublisherClient;
import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService; import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService;
import org.wso2.carbon.apimgt.integration.generated.client.publisher.api.APIsApi; import org.wso2.carbon.apimgt.integration.generated.client.publisher.api.APIIndividualApi;
import org.wso2.carbon.apimgt.webapp.publisher.internal.APIPublisherDataHolder; import org.wso2.carbon.apimgt.webapp.publisher.internal.APIPublisherDataHolder;
import org.wso2.carbon.apimgt.webapp.publisher.utils.MockApi; import org.wso2.carbon.apimgt.webapp.publisher.utils.MockAPIIndividualApi;
import org.wso2.carbon.base.MultitenantConstants; import org.wso2.carbon.base.MultitenantConstants;
import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.context.internal.OSGiDataHolder; import org.wso2.carbon.context.internal.OSGiDataHolder;
@ -87,7 +87,7 @@ public abstract class BaseAPIPublisherTest {
PublisherClient publisherClient = Mockito.mock(PublisherClient.class, Mockito.CALLS_REAL_METHODS); PublisherClient publisherClient = Mockito.mock(PublisherClient.class, Mockito.CALLS_REAL_METHODS);
doReturn(publisherClient).when(integrationClientService).getPublisherClient(); doReturn(publisherClient).when(integrationClientService).getPublisherClient();
APIsApi api = new MockApi(); APIIndividualApi api = new MockAPIIndividualApi();
Field field = PublisherClient.class.getDeclaredField("api"); Field field = PublisherClient.class.getDeclaredField("api");
field.setAccessible(true); field.setAccessible(true);
field.set(publisherClient, api); field.set(publisherClient, api);

View File

@ -0,0 +1,32 @@
/*
* Copyright (c) 2017, 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.apimgt.webapp.publisher.utils;
import org.wso2.carbon.apimgt.integration.generated.client.publisher.api.APICollectionApi;
import org.wso2.carbon.apimgt.integration.generated.client.publisher.model.APIList;
/**
* Class to create MockApi for testing.
*/
public class MockAPICollectionApi implements APICollectionApi {
@Override
public APIList apisGet(Integer limit, Integer offset, String query, String accept, String ifNoneMatch) {
return null;
}
}

View File

@ -17,9 +17,9 @@
*/ */
package org.wso2.carbon.apimgt.webapp.publisher.utils; package org.wso2.carbon.apimgt.webapp.publisher.utils;
import org.wso2.carbon.apimgt.integration.generated.client.publisher.api.APIsApi; import feign.Param;
import org.wso2.carbon.apimgt.integration.generated.client.publisher.api.APIIndividualApi;
import org.wso2.carbon.apimgt.integration.generated.client.publisher.model.API; import org.wso2.carbon.apimgt.integration.generated.client.publisher.model.API;
import org.wso2.carbon.apimgt.integration.generated.client.publisher.model.APIList;
import org.wso2.carbon.apimgt.integration.generated.client.publisher.model.FileInfo; import org.wso2.carbon.apimgt.integration.generated.client.publisher.model.FileInfo;
import java.io.File; import java.io.File;
@ -27,7 +27,7 @@ import java.io.File;
/** /**
* Class to create MockApi for testing. * Class to create MockApi for testing.
*/ */
public class MockApi implements APIsApi { public class MockAPIIndividualApi implements APIIndividualApi {
@Override @Override
public void apisApiIdDelete(String apiId, String ifMatch, String ifUnmodifiedSince) { public void apisApiIdDelete(String apiId, String ifMatch, String ifUnmodifiedSince) {
@ -75,12 +75,8 @@ public class MockApi implements APIsApi {
} }
@Override @Override
public APIList apisGet(Integer limit, Integer offset, String query, String accept, String ifNoneMatch) { public API apisPost(API body, @Param("contentType") String contentType, @Param("authorization") String authorization) {
return null;
}
@Override
public API apisPost(API body, String contentType) {
return new API(); return new API();
} }
} }

View File

@ -0,0 +1,656 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
~ Copyright 2005-2017 WSO2 Inc. (http://wso2.com)
~
~ Licensed 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.
-->
<!--
This is the main server configuration file
${carbon.home} represents the carbon.home system property.
Other system properties can be specified in a similar manner.
-->
<Server xmlns="http://wso2.org/projects/carbon/carbon.xml">
<!--
Product Name
-->
<Name>${product.name}</Name>
<!--
machine readable unique key to identify each product
-->
<ServerKey>${product.key}</ServerKey>
<!--
Product Version
-->
<Version>${product.version}</Version>
<!--
Host name or IP address of the machine hosting this server
e.g. www.wso2.org, 192.168.1.10
This is will become part of the End Point Reference of the
services deployed on this server instance.
-->
<!--HostName>www.wso2.org</HostName-->
<!--
Host name to be used for the Carbon management console
-->
<!--MgtHostName>mgt.wso2.org</MgtHostName-->
<!--
The URL of the back end server. This is where the admin services are hosted and
will be used by the clients in the front end server.
This is required only for the Front-end server. This is used when seperating BE server from FE server
-->
<ServerURL>local:/${carbon.context}/services/</ServerURL>
<!--
<ServerURL>https://${carbon.local.ip}:${carbon.management.port}${carbon.context}/services/</ServerURL>
-->
<!--
The URL of the index page. This is where the user will be redirected after signing in to the
carbon server.
-->
<!-- IndexPageURL>/carbon/admin/index.jsp</IndexPageURL-->
<!--
For cApp deployment, we have to identify the roles that can be acted by the current server.
The following property is used for that purpose. Any number of roles can be defined here.
Regular expressions can be used in the role.
Ex : <Role>.*</Role> means this server can act any role
-->
<ServerRoles>
<Role>${default.server.role}</Role>
</ServerRoles>
<!-- uncommnet this line to subscribe to a bam instance automatically -->
<!--<BamServerURL>https://bamhost:bamport/services/</BamServerURL>-->
<!--
The fully qualified name of the server
-->
<Package>org.wso2.carbon</Package>
<!--
Webapp context root of WSO2 Carbon management console.
-->
<WebContextRoot>/</WebContextRoot>
<!--
Proxy context path is a useful parameter to add a proxy path when a Carbon server is fronted by reverse proxy. In addtion
to the proxy host and proxy port this parameter allows you add a path component to external URLs. e.g.
URL of the Carbon server -> https://10.100.1.1:9443/carbon
URL of the reverse proxy -> https://prod.abc.com/appserver/carbon
appserver - proxy context path. This specially required whenever you are generating URLs to displace in
Carbon UI components.
-->
<!--
<MgtProxyContextPath></MgtProxyContextPath>
<ProxyContextPath></ProxyContextPath>
-->
<!-- In-order to get the registry http Port from the back-end when the default http transport is not the same-->
<!--RegistryHttpPort>9763</RegistryHttpPort-->
<!--
Number of items to be displayed on a management console page. This is used at the
backend server for pagination of various items.
-->
<ItemsPerPage>15</ItemsPerPage>
<!-- The endpoint URL of the cloud instance management Web service -->
<!--<InstanceMgtWSEndpoint>https://ec2.amazonaws.com/</InstanceMgtWSEndpoint>-->
<!--
Ports used by this server
-->
<Ports>
<!-- Ports offset. This entry will set the value of the ports defined below to
the define value + Offset.
e.g. Offset=2 and HTTPS port=9443 will set the effective HTTPS port to 9445
-->
<Offset>0</Offset>
<!-- The JMX Ports -->
<JMX>
<!--The port RMI registry is exposed-->
<RMIRegistryPort>9999</RMIRegistryPort>
<!--The port RMI server should be exposed-->
<RMIServerPort>11111</RMIServerPort>
</JMX>
<!-- Embedded LDAP server specific ports -->
<EmbeddedLDAP>
<!-- Port which embedded LDAP server runs -->
<LDAPServerPort>10389</LDAPServerPort>
<!-- Port which KDC (Kerberos Key Distribution Center) server runs -->
<KDCServerPort>8000</KDCServerPort>
</EmbeddedLDAP>
<!--
Override datasources JNDIproviderPort defined in bps.xml and datasources.properties files
-->
<!--<JNDIProviderPort>2199</JNDIProviderPort>-->
<!--Override receive port of thrift based entitlement service.-->
<ThriftEntitlementReceivePort>10500</ThriftEntitlementReceivePort>
</Ports>
<!--
JNDI Configuration
-->
<JNDI>
<!--
The fully qualified name of the default initial context factory
-->
<DefaultInitialContextFactory>org.wso2.carbon.tomcat.jndi.CarbonJavaURLContextFactory</DefaultInitialContextFactory>
<!--
The restrictions that are done to various JNDI Contexts in a Multi-tenant environment
-->
<Restrictions>
<!--
Contexts that will be available only to the super-tenant
-->
<!-- <SuperTenantOnly>
<UrlContexts>
<UrlContext>
<Scheme>foo</Scheme>
</UrlContext>
<UrlContext>
<Scheme>bar</Scheme>
</UrlContext>
</UrlContexts>
</SuperTenantOnly> -->
<!--
Contexts that are common to all tenants
-->
<AllTenants>
<UrlContexts>
<UrlContext>
<Scheme>java</Scheme>
</UrlContext>
<!-- <UrlContext>
<Scheme>foo</Scheme>
</UrlContext> -->
</UrlContexts>
</AllTenants>
<!--
All other contexts not mentioned above will be available on a per-tenant basis
(i.e. will not be shared among tenants)
-->
</Restrictions>
</JNDI>
<!--
Property to determine if the server is running an a cloud deployment environment.
This property should only be used to determine deployment specific details that are
applicable only in a cloud deployment, i.e when the server deployed *-as-a-service.
-->
<IsCloudDeployment>false</IsCloudDeployment>
<!--
Property to determine whether usage data should be collected for metering purposes
-->
<EnableMetering>false</EnableMetering>
<!-- The Max time a thread should take for execution in seconds -->
<MaxThreadExecutionTime>600</MaxThreadExecutionTime>
<!--
A flag to enable or disable Ghost Deployer. By default this is set to false. That is
because the Ghost Deployer works only with the HTTP/S transports. If you are using
other transports, don't enable Ghost Deployer.
-->
<GhostDeployment>
<Enabled>false</Enabled>
</GhostDeployment>
<!--
Eager loading or lazy loading is a design pattern commonly used in computer programming which
will initialize an object upon creation or load on-demand. In carbon, lazy loading is used to
load tenant when a request is received only. Similarly Eager loading is used to enable load
existing tenants after carbon server starts up. Using this feature, you will be able to include
or exclude tenants which are to be loaded when server startup.
We can enable only one LoadingPolicy at a given time.
1. Tenant Lazy Loading
This is the default behaviour and enabled by default. With this policy, tenants are not loaded at
server startup, but loaded based on-demand (i.e when a request is received for a tenant).
The default tenant idle time is 30 minutes.
2. Tenant Eager Loading
This is by default not enabled. It can be be enabled by un-commenting the <EagerLoading> section.
The eager loading configurations supported are as below. These configurations can be given as the
value for <Include> element with eager loading.
(i)Load all tenants when server startup - *
(ii)Load all tenants except foo.com & bar.com - *,!foo.com,!bar.com
(iii)Load only foo.com & bar.com to be included - foo.com,bar.com
-->
<Tenant>
<LoadingPolicy>
<LazyLoading>
<IdleTime>30</IdleTime>
</LazyLoading>
<!-- <EagerLoading>
<Include>*,!foo.com,!bar.com</Include>
</EagerLoading>-->
</LoadingPolicy>
</Tenant>
<!--
Caching related configurations
-->
<Cache>
<!-- Default cache timeout in minutes -->
<DefaultCacheTimeout>15</DefaultCacheTimeout>
</Cache>
<!--
Axis2 related configurations
-->
<Axis2Config>
<!--
Location of the Axis2 Services & Modules repository
This can be a directory in the local file system, or a URL.
e.g.
1. /home/wso2wsas/repository/ - An absolute path
2. repository - In this case, the path is relative to CARBON_HOME
3. file:///home/wso2wsas/repository/
4. http://wso2wsas/repository/
-->
<RepositoryLocation>${carbon.home}/repository/deployment/server/</RepositoryLocation>
<!--
Deployment update interval in seconds. This is the interval between repository listener
executions.
-->
<DeploymentUpdateInterval>15</DeploymentUpdateInterval>
<!--
Location of the main Axis2 configuration descriptor file, a.k.a. axis2.xml file
This can be a file on the local file system, or a URL
e.g.
1. /home/repository/axis2.xml - An absolute path
2. conf/axis2.xml - In this case, the path is relative to CARBON_HOME
3. file:///home/carbon/repository/axis2.xml
4. http://repository/conf/axis2.xml
-->
<ConfigurationFile>${carbon.home}/repository/conf/axis2/axis2.xml</ConfigurationFile>
<!--
ServiceGroupContextIdleTime, which will be set in ConfigurationContex
for multiple clients which are going to access the same ServiceGroupContext
Default Value is 30 Sec.
-->
<ServiceGroupContextIdleTime>30000</ServiceGroupContextIdleTime>
<!--
This repository location is used to crete the client side configuration
context used by the server when calling admin services.
-->
<ClientRepositoryLocation>${carbon.home}/repository/deployment/client/</ClientRepositoryLocation>
<!-- This axis2 xml is used in createing the configuration context by the FE server
calling to BE server -->
<clientAxis2XmlLocation>${carbon.home}/repository/conf/axis2/axis2_client.xml</clientAxis2XmlLocation>
<!-- If this parameter is set, the ?wsdl on an admin service will not give the admin service wsdl. -->
<HideAdminServiceWSDLs>true</HideAdminServiceWSDLs>
<!--WARNING-Use With Care! Uncommenting bellow parameter would expose all AdminServices in HTTP transport.
With HTTP transport your credentials and data routed in public channels are vulnerable for sniffing attacks.
Use bellow parameter ONLY if your communication channels are confirmed to be secured by other means -->
<!--HttpAdminServices>*</HttpAdminServices-->
</Axis2Config>
<!--
The default user roles which will be created when the server
is started up for the first time.
-->
<ServiceUserRoles>
<Role>
<Name>admin</Name>
<Description>Default Administrator Role</Description>
</Role>
<Role>
<Name>user</Name>
<Description>Default User Role</Description>
</Role>
</ServiceUserRoles>
<!--
Enable following config to allow Emails as usernames.
-->
<!--EnableEmailUserName>true</EnableEmailUserName-->
<!--
Security configurations
-->
<Security>
<!--
KeyStore which will be used for encrypting/decrypting passwords
and other sensitive information.
-->
<KeyStore>
<!-- Keystore file location-->
<Location>${carbon.home}/repository/resources/security/wso2carbon.jks</Location>
<!-- Keystore type (JKS/PKCS12 etc.)-->
<Type>JKS</Type>
<!-- Keystore password-->
<Password>wso2carbon</Password>
<!-- Private Key alias-->
<KeyAlias>wso2carbon</KeyAlias>
<!-- Private Key password-->
<KeyPassword>wso2carbon</KeyPassword>
</KeyStore>
<!--
System wide trust-store which is used to maintain the certificates of all
the trusted parties.
-->
<TrustStore>
<!-- trust-store file location -->
<Location>${carbon.home}/repository/resources/security/client-truststore.jks</Location>
<!-- trust-store type (JKS/PKCS12 etc.) -->
<Type>JKS</Type>
<!-- trust-store password -->
<Password>wso2carbon</Password>
</TrustStore>
<!--
The Authenticator configuration to be used at the JVM level. We extend the
java.net.Authenticator to make it possible to authenticate to given servers and
proxies.
-->
<NetworkAuthenticatorConfig>
<!--
Below is a sample configuration for a single authenticator. Please note that
all child elements are mandatory. Not having some child elements would lead to
exceptions at runtime.
-->
<!-- <Credential> -->
<!--
the pattern that would match a subset of URLs for which this authenticator
would be used
-->
<!-- <Pattern>regularExpression</Pattern> -->
<!--
the type of this authenticator. Allowed values are:
1. server
2. proxy
-->
<!-- <Type>proxy</Type> -->
<!-- the username used to log in to server/proxy -->
<!-- <Username>username</Username> -->
<!-- the password used to log in to server/proxy -->
<!-- <Password>password</Password> -->
<!-- </Credential> -->
</NetworkAuthenticatorConfig>
<!--
The Tomcat realm to be used for hosted Web applications. Allowed values are;
1. UserManager
2. Memory
If this is set to 'UserManager', the realm will pick users & roles from the system's
WSO2 User Manager. If it is set to 'memory', the realm will pick users & roles from
CARBON_HOME/repository/conf/tomcat/tomcat-users.xml
-->
<TomcatRealm>UserManager</TomcatRealm>
<!--Option to disable storing of tokens issued by STS-->
<DisableTokenStore>false</DisableTokenStore>
<!--
Security token store class name. If this is not set, default class will be
org.wso2.carbon.security.util.SecurityTokenStore
-->
<!--TokenStoreClassName>org.wso2.carbon.identity.sts.store.DBTokenStore</TokenStoreClassName-->
</Security>
<!--
The temporary work directory
-->
<WorkDirectory>${carbon.home}/tmp/work</WorkDirectory>
<!--
House-keeping configuration
-->
<HouseKeeping>
<!--
true - Start House-keeping thread on server startup
false - Do not start House-keeping thread on server startup.
The user will run it manually as and when he wishes.
-->
<AutoStart>true</AutoStart>
<!--
The interval in *minutes*, between house-keeping runs
-->
<Interval>10</Interval>
<!--
The maximum time in *minutes*, temp files are allowed to live
in the system. Files/directories which were modified more than
"MaxTempFileLifetime" minutes ago will be removed by the
house-keeping task
-->
<MaxTempFileLifetime>30</MaxTempFileLifetime>
</HouseKeeping>
<!--
Configuration for handling different types of file upload & other file uploading related
config parameters.
To map all actions to a particular FileUploadExecutor, use
<Action>*</Action>
-->
<FileUploadConfig>
<!--
The total file upload size limit in MB
-->
<TotalFileSizeLimit>100</TotalFileSizeLimit>
<Mapping>
<Actions>
<Action>keystore</Action>
<Action>certificate</Action>
<Action>*</Action>
</Actions>
<Class>org.wso2.carbon.ui.transports.fileupload.AnyFileUploadExecutor</Class>
</Mapping>
<Mapping>
<Actions>
<Action>jarZip</Action>
</Actions>
<Class>org.wso2.carbon.ui.transports.fileupload.JarZipUploadExecutor</Class>
</Mapping>
<Mapping>
<Actions>
<Action>dbs</Action>
</Actions>
<Class>org.wso2.carbon.ui.transports.fileupload.DBSFileUploadExecutor</Class>
</Mapping>
<Mapping>
<Actions>
<Action>tools</Action>
</Actions>
<Class>org.wso2.carbon.ui.transports.fileupload.ToolsFileUploadExecutor</Class>
</Mapping>
<Mapping>
<Actions>
<Action>toolsAny</Action>
</Actions>
<Class>org.wso2.carbon.ui.transports.fileupload.ToolsAnyFileUploadExecutor</Class>
</Mapping>
</FileUploadConfig>
<!--
Processors which process special HTTP GET requests such as ?wsdl, ?policy etc.
In order to plug in a processor to handle a special request, simply add an entry to this
section.
The value of the Item element is the first parameter in the query string(e.g. ?wsdl)
which needs special processing
The value of the Class element is a class which implements
org.wso2.carbon.transport.HttpGetRequestProcessor
-->
<HttpGetRequestProcessors>
<Processor>
<Item>info</Item>
<Class>org.wso2.carbon.core.transports.util.InfoProcessor</Class>
</Processor>
<Processor>
<Item>wsdl</Item>
<Class>org.wso2.carbon.core.transports.util.Wsdl11Processor</Class>
</Processor>
<Processor>
<Item>wsdl2</Item>
<Class>org.wso2.carbon.core.transports.util.Wsdl20Processor</Class>
</Processor>
<Processor>
<Item>xsd</Item>
<Class>org.wso2.carbon.core.transports.util.XsdProcessor</Class>
</Processor>
</HttpGetRequestProcessors>
<!-- Deployment Synchronizer Configuration. t Enabled value to true when running with "svn based" dep sync.
In master nodes you need to set both AutoCommit and AutoCheckout to true
and in worker nodes set only AutoCheckout to true.
-->
<DeploymentSynchronizer>
<Enabled>false</Enabled>
<AutoCommit>false</AutoCommit>
<AutoCheckout>true</AutoCheckout>
<RepositoryType>svn</RepositoryType>
<SvnUrl>http://svnrepo.example.com/repos/</SvnUrl>
<SvnUser>username</SvnUser>
<SvnPassword>password</SvnPassword>
<SvnUrlAppendTenantId>true</SvnUrlAppendTenantId>
</DeploymentSynchronizer>
<!-- Deployment Synchronizer Configuration. Uncomment the following section when running with "registry based" dep sync.
In master nodes you need to set both AutoCommit and AutoCheckout to true
and in worker nodes set only AutoCheckout to true.
-->
<!--<DeploymentSynchronizer>
<Enabled>true</Enabled>
<AutoCommit>false</AutoCommit>
<AutoCheckout>true</AutoCheckout>
</DeploymentSynchronizer>-->
<!-- Mediation persistence configurations. Only valid if mediation features are available i.e. ESB -->
<!--<MediationConfig>
<LoadFromRegistry>false</LoadFromRegistry>
<SaveToFile>false</SaveToFile>
<Persistence>enabled</Persistence>
<RegistryPersistence>enabled</RegistryPersistence>
</MediationConfig>-->
<!--
Server intializing code, specified as implementation classes of org.wso2.carbon.core.ServerInitializer.
This code will be run when the Carbon server is initialized
-->
<ServerInitializers>
<!--<Initializer></Initializer>-->
</ServerInitializers>
<!--
Indicates whether the Carbon Servlet is required by the system, and whether it should be
registered
-->
<RequireCarbonServlet>${require.carbon.servlet}</RequireCarbonServlet>
<!--
Carbon H2 OSGI Configuration
By default non of the servers start.
name="web" - Start the web server with the H2 Console
name="webPort" - The port (default: 8082)
name="webAllowOthers" - Allow other computers to connect
name="webSSL" - Use encrypted (HTTPS) connections
name="tcp" - Start the TCP server
name="tcpPort" - The port (default: 9092)
name="tcpAllowOthers" - Allow other computers to connect
name="tcpSSL" - Use encrypted (SSL) connections
name="pg" - Start the PG server
name="pgPort" - The port (default: 5435)
name="pgAllowOthers" - Allow other computers to connect
name="trace" - Print additional trace information; for all servers
name="baseDir" - The base directory for H2 databases; for all servers
-->
<!--H2DatabaseConfiguration>
<property name="web" />
<property name="webPort">8082</property>
<property name="webAllowOthers" />
<property name="webSSL" />
<property name="tcp" />
<property name="tcpPort">9092</property>
<property name="tcpAllowOthers" />
<property name="tcpSSL" />
<property name="pg" />
<property name="pgPort">5435</property>
<property name="pgAllowOthers" />
<property name="trace" />
<property name="baseDir">${carbon.home}</property>
</H2DatabaseConfiguration-->
<!--Disabling statistics reporter by default-->
<StatisticsReporterDisabled>true</StatisticsReporterDisabled>
<!-- Enable accessing Admin Console via HTTP -->
<!-- EnableHTTPAdminConsole>true</EnableHTTPAdminConsole -->
<!--
Default Feature Repository of WSO2 Carbon.
-->
<FeatureRepository>
<RepositoryName>default repository</RepositoryName>
<RepositoryURL>${p2.repo.url}</RepositoryURL>
</FeatureRepository>
<!--
Configure API Management
-->
<APIManagement>
<!--Uses the embedded API Manager by default. If you want to use an external
API Manager instance to manage APIs, configure below externalAPIManager-->
<Enabled>true</Enabled>
<!--Uncomment and configure API Gateway and
Publisher URLs to use external API Manager instance-->
<!--ExternalAPIManager>
<APIGatewayURL>http://localhost:8281</APIGatewayURL>
<APIPublisherURL>http://localhost:8281/publisher</APIPublisherURL>
</ExternalAPIManager-->
<LoadAPIContextsInServerStartup>true</LoadAPIContextsInServerStartup>
</APIManagement>
</Server>

View File

@ -22,13 +22,13 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId> <artifactId>carbon-devicemgt</artifactId>
<version>3.0.217-SNAPSHOT</version> <version>3.1.34-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<version>3.0.217-SNAPSHOT</version> <version>3.1.34-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>WSO2 Carbon - API Management Extensions Component</name> <name>WSO2 Carbon - API Management Extensions Component</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>

View File

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>certificate-mgt</artifactId> <artifactId>certificate-mgt</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.217-SNAPSHOT</version> <version>3.1.34-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>certificate-mgt</artifactId> <artifactId>certificate-mgt</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.217-SNAPSHOT</version> <version>3.1.34-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
~ /* ~ /*
~ * Copyright (c) ${date}, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. ~ * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~ * ~ *
~ * WSO2 Inc. licenses this file to you under the Apache License, ~ * WSO2 Inc. licenses this file to you under the Apache License,
~ * Version 2.0 (the "License"); you may not use this file except ~ * Version 2.0 (the "License"); you may not use this file except
@ -24,7 +24,7 @@
<parent> <parent>
<artifactId>certificate-mgt</artifactId> <artifactId>certificate-mgt</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.217-SNAPSHOT</version> <version>3.1.34-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -1,6 +1,6 @@
/* /*
* *
* Copyright (c) ${date}, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* *
* WSO2 Inc. licenses this file to you under the Apache License, * WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except * Version 2.0 (the "License"); you may not use this file except

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* *
* WSO2 Inc. licenses this file to you under the Apache License, * WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except * Version 2.0 (the "License"); you may not use this file except

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* *
* WSO2 Inc. licenses this file to you under the Apache License, * WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except * Version 2.0 (the "License"); you may not use this file except

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* *
* WSO2 Inc. licenses this file to you under the Apache License, * WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except * Version 2.0 (the "License"); you may not use this file except
@ -16,6 +16,7 @@
* under the License. * under the License.
* *
*/ */
package org.wso2.carbon.certificate.mgt.cert.jaxrs.api.beans; package org.wso2.carbon.certificate.mgt.cert.jaxrs.api.beans;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* *
* WSO2 Inc. licenses this file to you under the Apache License, * WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except * Version 2.0 (the "License"); you may not use this file except
@ -16,6 +16,7 @@
* under the License. * under the License.
* *
*/ */
package org.wso2.carbon.certificate.mgt.cert.jaxrs.api.beans; package org.wso2.carbon.certificate.mgt.cert.jaxrs.api.beans;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
@ -43,7 +44,6 @@ public class CertificateList extends BasePaginatedResult {
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append("{\n"); sb.append("{\n");
sb.append(" count: ").append(getCount()).append(",\n"); sb.append(" count: ").append(getCount()).append(",\n");
sb.append(" next: ").append(getNext()).append(",\n"); sb.append(" next: ").append(getNext()).append(",\n");
sb.append(" previous: ").append(getPrevious()).append(",\n"); sb.append(" previous: ").append(getPrevious()).append(",\n");
@ -51,5 +51,5 @@ public class CertificateList extends BasePaginatedResult {
sb.append("]}\n"); sb.append("]}\n");
return sb.toString(); return sb.toString();
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* *
* WSO2 Inc. licenses this file to you under the Apache License, * WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except * Version 2.0 (the "License"); you may not use this file except

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* *
* WSO2 Inc. licenses this file to you under the Apache License, * WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except * Version 2.0 (the "License"); you may not use this file except
@ -16,6 +16,7 @@
* under the License. * under the License.
* *
*/ */
package org.wso2.carbon.certificate.mgt.cert.jaxrs.api.beans; package org.wso2.carbon.certificate.mgt.cert.jaxrs.api.beans;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* *
* WSO2 Inc. licenses this file to you under the Apache License, * WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except * Version 2.0 (the "License"); you may not use this file except
@ -16,6 +16,7 @@
* under the License. * under the License.
* *
*/ */
package org.wso2.carbon.certificate.mgt.cert.jaxrs.api.beans; package org.wso2.carbon.certificate.mgt.cert.jaxrs.api.beans;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;

View File

@ -16,7 +16,6 @@
* under the License. * under the License.
*/ */
package org.wso2.carbon.certificate.mgt.cert.jaxrs.api.beans; package org.wso2.carbon.certificate.mgt.cert.jaxrs.api.beans;
public class ValidationResponse { public class ValidationResponse {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* *
* WSO2 Inc. licenses this file to you under the Apache License, * WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except * Version 2.0 (the "License"); you may not use this file except

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* *
* WSO2 Inc. licenses this file to you under the Apache License, * WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except * Version 2.0 (the "License"); you may not use this file except

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* *
* WSO2 Inc. licenses this file to you under the Apache License, * WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except * Version 2.0 (the "License"); you may not use this file except

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* *
* WSO2 Inc. licenses this file to you under the Apache License, * WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except * Version 2.0 (the "License"); you may not use this file except

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* *
* WSO2 Inc. licenses this file to you under the Apache License, * WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except * Version 2.0 (the "License"); you may not use this file except

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* *
* WSO2 Inc. licenses this file to you under the Apache License, * WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except * Version 2.0 (the "License"); you may not use this file except

View File

@ -1,6 +1,6 @@
/* /*
* *
* Copyright (c) ${date}, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* *
* WSO2 Inc. licenses this file to you under the Apache License, * WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except * Version 2.0 (the "License"); you may not use this file except
@ -17,6 +17,7 @@
* under the License. * under the License.
* / * /
*/ */
package org.wso2.carbon.certificate.mgt.cert.jaxrs.api.swagger.extension; package org.wso2.carbon.certificate.mgt.cert.jaxrs.api.swagger.extension;
import io.swagger.annotations.SwaggerDefinition; import io.swagger.annotations.SwaggerDefinition;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* *
* WSO2 Inc. licenses this file to you under the Apache License, * WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except * Version 2.0 (the "License"); you may not use this file except
@ -16,6 +16,7 @@
* under the License. * under the License.
* *
*/ */
package org.wso2.carbon.certificate.mgt.cert.jaxrs.api.util; package org.wso2.carbon.certificate.mgt.cert.jaxrs.api.util;
import javax.servlet.*; import javax.servlet.*;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* *
* WSO2 Inc. licenses this file to you under the Apache License, * WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except * Version 2.0 (the "License"); you may not use this file except

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* *
* WSO2 Inc. licenses this file to you under the Apache License, * WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except * Version 2.0 (the "License"); you may not use this file except
@ -16,6 +16,7 @@
* under the License. * under the License.
* *
*/ */
package org.wso2.carbon.certificate.mgt.cert.jaxrs.api.util; package org.wso2.carbon.certificate.mgt.cert.jaxrs.api.util;
import org.wso2.carbon.certificate.mgt.cert.jaxrs.api.beans.ErrorResponse; import org.wso2.carbon.certificate.mgt.cert.jaxrs.api.beans.ErrorResponse;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* *
* WSO2 Inc. licenses this file to you under the Apache License, * WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except * Version 2.0 (the "License"); you may not use this file except

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- <!--
~ Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. ~ Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~ ~
~ WSO2 Inc. licenses this file to you under the Apache License, ~ WSO2 Inc. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except ~ Version 2.0 (the "License"); you may not use this file except

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="ISO-8859-1"?> <?xml version="1.0" encoding="ISO-8859-1"?>
<!-- <!--
~ Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. ~ Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~ ~
~ WSO2 Inc. licenses this file to you under the Apache License, ~ WSO2 Inc. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except ~ Version 2.0 (the "License"); you may not use this file except

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- <!--
~ /* ~ /*
~ * Copyright (c) ${date}, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. ~ * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~ * ~ *
~ * WSO2 Inc. licenses this file to you under the Apache License, ~ * WSO2 Inc. licenses this file to you under the Apache License,
~ * Version 2.0 (the "License"); you may not use this file except ~ * Version 2.0 (the "License"); you may not use this file except

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- <!--
~ Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. ~ Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~ ~
~ WSO2 Inc. licenses this file to you under the Apache License, ~ WSO2 Inc. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except ~ Version 2.0 (the "License"); you may not use this file except

View File

@ -21,13 +21,13 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>certificate-mgt</artifactId> <artifactId>certificate-mgt</artifactId>
<version>3.0.217-SNAPSHOT</version> <version>3.1.34-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.certificate.mgt.core</artifactId> <artifactId>org.wso2.carbon.certificate.mgt.core</artifactId>
<version>3.0.217-SNAPSHOT</version> <version>3.1.34-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - Certificate Management Core</name> <name>WSO2 Carbon - Certificate Management Core</name>
<description>WSO2 Carbon - Certificate Management Core</description> <description>WSO2 Carbon - Certificate Management Core</description>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
~ /* ~ /*
~ * Copyright (c) ${date}, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. ~ * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~ * ~ *
~ * WSO2 Inc. licenses this file to you under the Apache License, ~ * WSO2 Inc. licenses this file to you under the Apache License,
~ * Version 2.0 (the "License"); you may not use this file except ~ * Version 2.0 (the "License"); you may not use this file except
@ -24,7 +24,7 @@
<parent> <parent>
<artifactId>certificate-mgt</artifactId> <artifactId>certificate-mgt</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.217-SNAPSHOT</version> <version>3.1.34-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -1,6 +1,6 @@
/* /*
* *
* Copyright (c) ${date}, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* *
* WSO2 Inc. licenses this file to you under the Apache License, * WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except * Version 2.0 (the "License"); you may not use this file except

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* *
* WSO2 Inc. licenses this file to you under the Apache License, * WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except * Version 2.0 (the "License"); you may not use this file except

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* *
* WSO2 Inc. licenses this file to you under the Apache License, * WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except * Version 2.0 (the "License"); you may not use this file except

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* *
* WSO2 Inc. licenses this file to you under the Apache License, * WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except * Version 2.0 (the "License"); you may not use this file except

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* *
* WSO2 Inc. licenses this file to you under the Apache License, * WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except * Version 2.0 (the "License"); you may not use this file except

View File

@ -1,3 +1,21 @@
/*
* Copyright (c) 2017, 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.certificate.mgt.jaxrs.api.impl; package org.wso2.carbon.certificate.mgt.jaxrs.api.impl;
import org.apache.commons.codec.binary.Base64; import org.apache.commons.codec.binary.Base64;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* *
* WSO2 Inc. licenses this file to you under the Apache License, * WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except * Version 2.0 (the "License"); you may not use this file except

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* *
* WSO2 Inc. licenses this file to you under the Apache License, * WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except * Version 2.0 (the "License"); you may not use this file except
@ -16,6 +16,7 @@
* under the License. * under the License.
* *
*/ */
package org.wso2.carbon.certificate.mgt.jaxrs.beans; package org.wso2.carbon.certificate.mgt.jaxrs.beans;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
@ -69,11 +70,9 @@ public class ErrorListItem {
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append("errorItem {\n"); sb.append("errorItem {\n");
sb.append(" code: ").append(code).append("\n"); sb.append(" code: ").append(code).append("\n");
sb.append(" message: ").append(message).append("\n"); sb.append(" message: ").append(message).append("\n");
sb.append("}\n"); sb.append("}\n");
return sb.toString(); return sb.toString();
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* *
* WSO2 Inc. licenses this file to you under the Apache License, * WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except * Version 2.0 (the "License"); you may not use this file except

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* *
* WSO2 Inc. licenses this file to you under the Apache License, * WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except * Version 2.0 (the "License"); you may not use this file except

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* *
* WSO2 Inc. licenses this file to you under the Apache License, * WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except * Version 2.0 (the "License"); you may not use this file except

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* *
* WSO2 Inc. licenses this file to you under the Apache License, * WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except * Version 2.0 (the "License"); you may not use this file except

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- <!--
~ Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. ~ Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~ ~
~ WSO2 Inc. licenses this file to you under the Apache License, ~ WSO2 Inc. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except ~ Version 2.0 (the "License"); you may not use this file except

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="ISO-8859-1"?> <?xml version="1.0" encoding="ISO-8859-1"?>
<!-- <!--
~ Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. ~ Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~ ~
~ WSO2 Inc. licenses this file to you under the Apache License, ~ WSO2 Inc. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except ~ Version 2.0 (the "License"); you may not use this file except

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- <!--
~ /* ~ /*
~ * Copyright (c) ${date}, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. ~ * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~ * ~ *
~ * WSO2 Inc. licenses this file to you under the Apache License, ~ * WSO2 Inc. licenses this file to you under the Apache License,
~ * Version 2.0 (the "License"); you may not use this file except ~ * Version 2.0 (the "License"); you may not use this file except

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- <!--
~ Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. ~ Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~ ~
~ WSO2 Inc. licenses this file to you under the Apache License, ~ WSO2 Inc. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except ~ Version 2.0 (the "License"); you may not use this file except

View File

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId> <artifactId>carbon-devicemgt</artifactId>
<version>3.0.217-SNAPSHOT</version> <version>3.1.34-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>certificate-mgt</artifactId> <artifactId>certificate-mgt</artifactId>
<version>3.0.217-SNAPSHOT</version> <version>3.1.34-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>WSO2 Carbon - Certificate Management Component</name> <name>WSO2 Carbon - Certificate Management Component</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>

View File

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt-extensions</artifactId> <artifactId>device-mgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.217-SNAPSHOT</version> <version>3.1.34-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt-extensions</artifactId> <artifactId>device-mgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.217-SNAPSHOT</version> <version>3.1.34-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt-extensions</artifactId> <artifactId>device-mgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.217-SNAPSHOT</version> <version>3.1.34-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -21,6 +21,8 @@ package org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm;
import com.google.gson.JsonArray; import com.google.gson.JsonArray;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import com.google.gson.JsonPrimitive; import com.google.gson.JsonPrimitive;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.Device;
import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.common.DeviceManagementException;
import org.wso2.carbon.device.mgt.common.push.notification.NotificationContext; import org.wso2.carbon.device.mgt.common.push.notification.NotificationContext;
@ -37,10 +39,13 @@ import java.util.List;
public class FCMNotificationStrategy implements NotificationStrategy { public class FCMNotificationStrategy implements NotificationStrategy {
private static final Log log = LogFactory.getLog(FCMNotificationStrategy.class);
private static final String NOTIFIER_TYPE_FCM = "FCM";
private static final String FCM_TOKEN = "FCM_TOKEN"; private static final String FCM_TOKEN = "FCM_TOKEN";
private static final String FCM_ENDPOINT = "https://fcm.googleapis.com/fcm/send"; private static final String FCM_ENDPOINT = "https://fcm.googleapis.com/fcm/send";
private static final String FCM_API_KEY = "fcmAPIKey"; private static final String FCM_API_KEY = "fcmAPIKey";
private static final int TIME_TO_LIVE = 60; private static final int TIME_TO_LIVE = 5 * 60; //Set FCM TTL to 5 minutes
private static final int HTTP_STATUS_CODE_OK = 200; private static final int HTTP_STATUS_CODE_OK = 200;
private final PushNotificationConfig config; private final PushNotificationConfig config;
@ -56,9 +61,16 @@ public class FCMNotificationStrategy implements NotificationStrategy {
@Override @Override
public void execute(NotificationContext ctx) throws PushNotificationExecutionFailedException { public void execute(NotificationContext ctx) throws PushNotificationExecutionFailedException {
try { try {
Device device = if (NOTIFIER_TYPE_FCM.equals(config.getType())) {
FCMDataHolder.getInstance().getDeviceManagementProviderService().getDeviceWithTypeProperties(ctx.getDeviceId()); Device device = FCMDataHolder.getInstance().getDeviceManagementProviderService()
.getDeviceWithTypeProperties(ctx.getDeviceId());
this.sendWakeUpCall(ctx.getOperation().getCode(), device); this.sendWakeUpCall(ctx.getOperation().getCode(), device);
} else {
if (log.isDebugEnabled()) {
log.debug("Not using FCM notifier as notifier type is set to " + config.getType() +
" in Platform Configurations.");
}
}
} catch (DeviceManagementException e) { } catch (DeviceManagementException e) {
throw new PushNotificationExecutionFailedException("Error occurred while retrieving device information", e); throw new PushNotificationExecutionFailedException("Error occurred while retrieving device information", e);
} catch (IOException e) { } catch (IOException e) {
@ -76,12 +88,12 @@ public class FCMNotificationStrategy implements NotificationStrategy {
} }
private void sendWakeUpCall(String message, private void sendWakeUpCall(String message, Device device) throws IOException,
Device device) throws IOException, PushNotificationExecutionFailedException { PushNotificationExecutionFailedException {
OutputStream os = null; OutputStream os = null;
byte[] bytes = getFCMRequest(message, getFCMToken(device.getProperties())).getBytes(); byte[] bytes = getFCMRequest(message, getFCMToken(device.getProperties())).getBytes();
HttpURLConnection conn = null; HttpURLConnection conn;
try { try {
conn = (HttpURLConnection) new URL(FCM_ENDPOINT).openConnection(); conn = (HttpURLConnection) new URL(FCM_ENDPOINT).openConnection();
conn.setRequestProperty("Content-Type", "application/json"); conn.setRequestProperty("Content-Type", "application/json");
@ -96,6 +108,9 @@ public class FCMNotificationStrategy implements NotificationStrategy {
} }
} }
int status = conn.getResponseCode(); int status = conn.getResponseCode();
if (log.isDebugEnabled()) {
log.debug("Result code: " + status + ", Message: " + conn.getResponseMessage());
}
if (status != HTTP_STATUS_CODE_OK) { if (status != HTTP_STATUS_CODE_OK) {
throw new PushNotificationExecutionFailedException("Push notification sending failed with the HTTP " + throw new PushNotificationExecutionFailedException("Push notification sending failed with the HTTP " +
"error code '" + status + "'"); "error code '" + status + "'");

View File

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt-extensions</artifactId> <artifactId>device-mgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.217-SNAPSHOT</version> <version>3.1.34-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt-extensions</artifactId> <artifactId>device-mgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.217-SNAPSHOT</version> <version>3.1.34-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -0,0 +1,43 @@
/*
* Copyright (c) 2018, 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.extensions.push.notification.provider.mqtt;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import java.io.File;
/**
* Util class to initialize carbon-context.
*/
public class CarbonContextInitializationUtil {
private final static String CARBON_HOME = "carbon.home";
public static void initializeCarbonContext() {
if (System.getProperty(CARBON_HOME) == null) {
File file = new File("src/test/resources");
if (file.exists()) {
System.setProperty(CARBON_HOME, file.getAbsolutePath());
}
}
PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(
org.wso2.carbon.base.MultitenantConstants.SUPER_TENANT_DOMAIN_NAME);
PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantId(
org.wso2.carbon.base.MultitenantConstants.SUPER_TENANT_ID);
}
}

View File

@ -35,8 +35,8 @@ import java.io.IOException;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
/* /**
Unit tests for MQTTBasedPushNotificationProvider class * Unit tests for MQTTBasedPushNotificationProvider class
*/ */
public class MQTTBasedPushNotificationProviderTest { public class MQTTBasedPushNotificationProviderTest {
private MQTTBasedPushNotificationProvider mqttBasedPushNotificationProvider; private MQTTBasedPushNotificationProvider mqttBasedPushNotificationProvider;
@ -47,7 +47,7 @@ public class MQTTBasedPushNotificationProviderTest {
@BeforeClass @BeforeClass
public void init() throws NoSuchFieldException, IllegalAccessException, IOException, RegistryException, public void init() throws NoSuchFieldException, IllegalAccessException, IOException, RegistryException,
OutputEventAdapterException { OutputEventAdapterException {
initializeCarbonContext(); CarbonContextInitializationUtil.initializeCarbonContext();
mqttBasedPushNotificationProvider = Mockito.mock(MQTTBasedPushNotificationProvider.class, mqttBasedPushNotificationProvider = Mockito.mock(MQTTBasedPushNotificationProvider.class,
Mockito.CALLS_REAL_METHODS); Mockito.CALLS_REAL_METHODS);
carbonOutputEventAdapterService = Mockito.mock(CarbonOutputEventAdapterService.class, carbonOutputEventAdapterService = Mockito.mock(CarbonOutputEventAdapterService.class,
@ -55,19 +55,6 @@ public class MQTTBasedPushNotificationProviderTest {
Mockito.doReturn(true).when(carbonOutputEventAdapterService).isPolled(ADAPTER_NAME); Mockito.doReturn(true).when(carbonOutputEventAdapterService).isPolled(ADAPTER_NAME);
} }
private void initializeCarbonContext() throws IOException, RegistryException {
if (System.getProperty("carbon.home") == null) {
File file = new File("src/test/resources");
if (file.exists()) {
System.setProperty("carbon.home", file.getAbsolutePath());
}
}
PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(
org.wso2.carbon.base.MultitenantConstants.SUPER_TENANT_DOMAIN_NAME);
PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantId(
org.wso2.carbon.base.MultitenantConstants.SUPER_TENANT_ID);
}
@Test(description = "test getType method") @Test(description = "test getType method")
public void testGetType() { public void testGetType() {
String type = mqttBasedPushNotificationProvider.getType(); String type = mqttBasedPushNotificationProvider.getType();

View File

@ -63,7 +63,7 @@ public class MQTTNotificationStrategyTest {
@BeforeClass @BeforeClass
public void init() throws NoSuchFieldException, IllegalAccessException, IOException, RegistryException, public void init() throws NoSuchFieldException, IllegalAccessException, IOException, RegistryException,
OutputEventAdapterException { OutputEventAdapterException {
initializeCarbonContext(); CarbonContextInitializationUtil.initializeCarbonContext();
mqttNotificationStrategy = Mockito.mock(MQTTNotificationStrategy.class, Mockito.CALLS_REAL_METHODS); mqttNotificationStrategy = Mockito.mock(MQTTNotificationStrategy.class, Mockito.CALLS_REAL_METHODS);
carbonOutputEventAdapterService = Mockito.mock(CarbonOutputEventAdapterService.class, carbonOutputEventAdapterService = Mockito.mock(CarbonOutputEventAdapterService.class,
Mockito.CALLS_REAL_METHODS); Mockito.CALLS_REAL_METHODS);
@ -72,19 +72,6 @@ public class MQTTNotificationStrategyTest {
Mockito.doNothing().when(carbonOutputEventAdapterService).destroy(ADAPTER_NAME); Mockito.doNothing().when(carbonOutputEventAdapterService).destroy(ADAPTER_NAME);
} }
private void initializeCarbonContext() throws IOException, RegistryException {
if (System.getProperty("carbon.home") == null) {
File file = new File("src/test/resources");
if (file.exists()) {
System.setProperty("carbon.home", file.getAbsolutePath());
}
}
PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(
org.wso2.carbon.base.MultitenantConstants.SUPER_TENANT_DOMAIN_NAME);
PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantId(
org.wso2.carbon.base.MultitenantConstants.SUPER_TENANT_ID);
}
@Test(description = "Testing the constructor of MQTTNotificationStrategy class") @Test(description = "Testing the constructor of MQTTNotificationStrategy class")
public void getNotificationStrategy() { public void getNotificationStrategy() {
Map<String, String> properties = new HashMap<>(); Map<String, String> properties = new HashMap<>();

View File

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt-extensions</artifactId> <artifactId>device-mgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.217-SNAPSHOT</version> <version>3.1.34-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>carbon-devicemgt</artifactId> <artifactId>carbon-devicemgt</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.217-SNAPSHOT</version> <version>3.1.34-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

View File

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt</artifactId> <artifactId>device-mgt</artifactId>
<version>3.0.217-SNAPSHOT</version> <version>3.1.34-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>device-mgt</artifactId> <artifactId>device-mgt</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.217-SNAPSHOT</version> <version>3.1.34-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -67,8 +67,8 @@ import javax.ws.rs.core.Response;
} }
) )
@Path("/activities") @Path("/activities")
@Api(value = "Activity Info Provider", description = "Activity related information manipulation. For example" + @Api(value = "Getting Activity Details", description = "Get the details of the operations/activities executed by the" +
" operation details and responses from devices.") " server on the registered devices during a defined time period.")
@Scopes( @Scopes(
scopes = { scopes = {
@Scope( @Scope(
@ -88,9 +88,9 @@ public interface ActivityInfoProviderService {
@ApiOperation( @ApiOperation(
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = "GET", httpMethod = "GET",
value = "Getting Details of an Activity", value = "Getting the Details of a Specific Activity",
notes = "Retrieve the details of a specific activity/operation, such as the meta information of " + notes = "Retrieve the details of a specific activity/operation, such as the meta information of an " +
"an operation, including the responses from the devices.", "operation, and the responses from the devices.",
tags = "Activity Info Provider", tags = "Activity Info Provider",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {
@ -142,7 +142,7 @@ public interface ActivityInfoProviderService {
Response getActivity( Response getActivity(
@ApiParam( @ApiParam(
name = "id", name = "id",
value = "Activity id of the operation/activity.", value = "Activity ID of the operation/activity.",
required = true, required = true,
defaultValue = "ACTIVITY_1") defaultValue = "ACTIVITY_1")
@PathParam("id") @PathParam("id")
@ -161,9 +161,10 @@ public interface ActivityInfoProviderService {
@ApiOperation( @ApiOperation(
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = "GET", httpMethod = "GET",
value = "Getting Details of activities for given set of activity/operation Ids", value = "Getting Activity Details of Specified Activity/Operation IDs",
notes = "Retrieve the details of specific activity/operation Ids, such as the meta information of " + notes = "Retrieve the details of activities or operations, such as the meta information of an operation," +
"an operation, including the responses from the devices.", " and the responses from the devices."+
"Define the activity or operation IDs as comma separated values.",
tags = "Activity Info Provider", tags = "Activity Info Provider",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {
@ -213,7 +214,7 @@ public interface ActivityInfoProviderService {
Response getActivities( Response getActivities(
@ApiParam( @ApiParam(
name = "ids", name = "ids",
value = "Comma separated activity/operation ids", value = "Comma separated activity/operation IDs",
required = true, required = true,
defaultValue = "ACTIVITY_0") defaultValue = "ACTIVITY_0")
@QueryParam("ids") ActivityIdList activityIdList); @QueryParam("ids") ActivityIdList activityIdList);
@ -224,9 +225,8 @@ public interface ActivityInfoProviderService {
@ApiOperation( @ApiOperation(
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = "GET", httpMethod = "GET",
value = "Getting Details of an Activity for a specific device", value = "Getting a Specific Activity Details of a Device",
notes = "Retrieve the details of a specific activity/operation, such as the meta information of " + notes = "Retrieve the details of a specific activity/operation, that was sent to a specific device.",
"an operation, including the responses from a given device",
tags = "Activity Info Provider", tags = "Activity Info Provider",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {
@ -286,7 +286,7 @@ public interface ActivityInfoProviderService {
String id, String id,
@ApiParam( @ApiParam(
name = "devicetype", name = "devicetype",
value = "The device type name, such as ios, android, windows or fire-alarm.", value = "The device type name, such as ios, android, windows, or fire-alarm.",
required = true) required = true)
@PathParam("devicetype") @PathParam("devicetype")
@Size(max = 45) @Size(max = 45)

View File

@ -60,8 +60,8 @@ import javax.ws.rs.core.Response;
} }
) )
@Path("/configuration") @Path("/configuration")
@Api(value = "Configuration Management", description = "The general platform configuration management capabilities are exposed " + @Api(value = "Configuration Management", description = "The general platform configuration management capabilities " +
"through this API.") "are exposed through this API.")
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON)
@Scopes(scopes = { @Scopes(scopes = {
@ -87,8 +87,8 @@ public interface ConfigurationManagementService {
httpMethod = "GET", httpMethod = "GET",
value = "Getting General Platform Configurations", value = "Getting General Platform Configurations",
notes = "WSO2 EMM monitors policies to verify that the devices comply with the policies enforced on them." + notes = "WSO2 EMM monitors policies to verify that the devices comply with the policies enforced on them." +
"General platform configurations include the settings on how often the device need to be monitored. " + "General platform configurations include the settings on how often the device need to be " +
"Using this REST API you can get the general platform level configurations.", "monitored." + "Using this REST API you can get the general platform level configurations.",
tags = "Configuration Management", tags = "Configuration Management",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {
@ -119,7 +119,8 @@ public interface ConfigurationManagementService {
), ),
@ApiResponse( @ApiResponse(
code = 304, code = 304,
message = "Not Modified. \n Empty body because the client already has the latest version of the requested resource."), message = "Not Modified. \n Empty body because the client already has the latest version of the " +
"requested resource."),
@ApiResponse( @ApiResponse(
code = 406, code = 406,
message = "Not Acceptable.\n The requested media type is not supported."), message = "Not Acceptable.\n The requested media type is not supported."),
@ -146,8 +147,8 @@ public interface ConfigurationManagementService {
httpMethod = "PUT", httpMethod = "PUT",
value = "Updating General Platform Configurations", value = "Updating General Platform Configurations",
notes = "WSO2 EMM monitors policies to verify that the devices comply with the policies enforced on them." + notes = "WSO2 EMM monitors policies to verify that the devices comply with the policies enforced on them." +
"General platform configurations include the settings on how often the the device need to be monitored." + "General platform configurations include the settings on how often the the device need to be " +
"Using this REST API you can update the general platform level configurations.", "monitored. Using this REST API you can update the general platform level configurations.",
tags = "Configuration Management", tags = "Configuration Management",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {

View File

@ -112,8 +112,8 @@ public interface DeviceAgentService {
@ApiOperation( @ApiOperation(
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = "POST", httpMethod = "POST",
value = "Create a device instance", value = "Creating a Device Instance",
notes = "Create a device Instance", notes = "Create a device instance using this API. Since this is not a physical device you are not able to try out device operations.",
tags = "Device Management", tags = "Device Management",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {
@ -157,7 +157,7 @@ public interface DeviceAgentService {
"Server error occurred while retrieving the device details.", "Server error occurred while retrieving the device details.",
response = ErrorResponse.class) response = ErrorResponse.class)
}) })
Response enrollDevice(@ApiParam(name = "device", value = "Device object with data.", required = true) Response enrollDevice(@ApiParam(name = "device", value = "Define the payload to create a device instance. You can double click on the Example Value and define your values in it to create the instance.", required = true)
@Valid Device device); @Valid Device device);
@DELETE @DELETE
@ -186,7 +186,7 @@ public interface DeviceAgentService {
"Server error occurred while dis-enrolling the device.") "Server error occurred while dis-enrolling the device.")
}) })
Response disEnrollDevice( Response disEnrollDevice(
@ApiParam(name = "type", value = "The unique device identifier.") @PathParam("type") String type, @ApiParam(name = "type", value = "Define the device type, such as android, ios, or windows.") @PathParam("type") String type,
@ApiParam(name = "id", value = "The unique device identifier.") @PathParam("id") String id); @ApiParam(name = "id", value = "The unique device identifier.") @PathParam("id") String id);
@PUT @PUT
@ -194,8 +194,8 @@ public interface DeviceAgentService {
@ApiOperation( @ApiOperation(
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = "PUT", httpMethod = "PUT",
value = "modify device", value = "Updating the Device Details",
notes = "modify device", notes = "You are able to update the details of a device using the API.",
tags = "Device Agent Management", tags = "Device Agent Management",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {
@ -239,15 +239,15 @@ public interface DeviceAgentService {
"Server error occurred while retrieving the device details.", "Server error occurred while retrieving the device details.",
response = ErrorResponse.class) response = ErrorResponse.class)
}) })
Response updateDevice(@ApiParam(name = "type", value = "The device type, such as ios, android or windows....etc", required = true) Response updateDevice(@ApiParam(name = "type", value = "The device type, such as ios, android, or windows.", required = true)
@PathParam("type") String type, @PathParam("type") String type,
@ApiParam(name = "id", value = "The device id.", required = true) @ApiParam(name = "id", value = "The device ID.", required = true)
@PathParam("id") String deviceId, @PathParam("id") String deviceId,
@ApiParam(name = "device", value = "Device object with data.", required = true) @ApiParam(name = "device", value = "Update the device details in the device object.", required = true)
@Valid Device updateDevice); @Valid Device updateDevice);
@POST @POST
@Path("/events/publish/{type}/{deviceId}") @Path("events/publish/{type}/{deviceId}")
@ApiOperation( @ApiOperation(
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
consumes = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON,
@ -303,11 +303,11 @@ public interface DeviceAgentService {
Map<String, Object> payloadData, Map<String, Object> payloadData,
@ApiParam( @ApiParam(
name = "type", name = "type",
value = "name of the device type") value = "The name of the device type, such as android, ios, or windows.")
@PathParam("type") String type, @PathParam("type") String type,
@ApiParam( @ApiParam(
name = "deviceId", name = "deviceId",
value = "deviceId of the device") value = "The device ID.")
@PathParam("deviceId") String deviceId); @PathParam("deviceId") String deviceId);
@POST @POST
@ -317,7 +317,8 @@ public interface DeviceAgentService {
consumes = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON,
httpMethod = "POST", httpMethod = "POST",
value = "Publishing Events data only", value = "Publishing Events data only",
notes = "Publish events received by the device client to the WSO2 Data Analytics Server (DAS) using this API.", notes = "Publish events received by the device client to the WSO2 Data Analytics Server (DAS) using this" +
" API.",
tags = "Device Agent Management", tags = "Device Agent Management",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {
@ -343,7 +344,8 @@ public interface DeviceAgentService {
}), }),
@ApiResponse( @ApiResponse(
code = 303, code = 303,
message = "See Other. \n The source can be retrieved from the URL specified in the location header.", message = "See Other. \n The source can be retrieved from the URL specified in the " +
"location header.",
responseHeaders = { responseHeaders = {
@ResponseHeader( @ResponseHeader(
name = "Content-Location", name = "Content-Location",
@ -353,7 +355,8 @@ public interface DeviceAgentService {
message = "Bad Request. \n Invalid request or validation error."), message = "Bad Request. \n Invalid request or validation error."),
@ApiResponse( @ApiResponse(
code = 415, code = 415,
message = "Unsupported media type. \n The format of the requested entity was not supported."), message = "Unsupported media type. \n The format of the requested entity was not " +
"supported."),
@ApiResponse( @ApiResponse(
code = 500, code = 500,
message = "Internal Server Error. \n " + message = "Internal Server Error. \n " +
@ -380,8 +383,8 @@ public interface DeviceAgentService {
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
consumes = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON,
httpMethod = "GET", httpMethod = "GET",
value = "Get pending operation of the given device", value = "Getting All the Pending Operations of a Device",
notes = "Returns the Operations.", notes = "You can get all the list of pending operations of a device.",
tags = "Device Agent Management", tags = "Device Agent Management",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {
@ -405,7 +408,8 @@ public interface DeviceAgentService {
"Used by caches, or in conditional requests."), "Used by caches, or in conditional requests."),
@ResponseHeader( @ResponseHeader(
name = "Last-Modified", name = "Last-Modified",
description = "Date and time the resource has been modified the last time.\n" + description = "Date and time the resource has been modified the last " +
"time.\n" +
"Used by caches, or in conditional requests."), "Used by caches, or in conditional requests."),
}), }),
@ApiResponse( @ApiResponse(
@ -426,9 +430,9 @@ public interface DeviceAgentService {
"Server error occurred while retrieving information requested device.", "Server error occurred while retrieving information requested device.",
response = ErrorResponse.class) response = ErrorResponse.class)
}) })
Response getPendingOperations(@ApiParam(name = "type", value = "The device type, such as ios, android or windows.", required = true) Response getPendingOperations(@ApiParam(name = "type", value = "The device type, such as ios, android, or windows.", required = true)
@PathParam("type") String type, @PathParam("type") String type,
@ApiParam(name = "id", value = "The device id.", required = true) @ApiParam(name = "id", value = "The device ID.", required = true)
@PathParam("id") String deviceId); @PathParam("id") String deviceId);
@GET @GET
@ -437,8 +441,9 @@ public interface DeviceAgentService {
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
consumes = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON,
httpMethod = "GET", httpMethod = "GET",
value = "Get pending operation of the given device", value = "Getting the Next Pending Operations of a Device",
notes = "Returns the Operation.", notes = "There can be many operations that are pending on the device end. Get the next pending operation " +
"of a specific device using this API.",
tags = "Device Agent Management", tags = "Device Agent Management",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {
@ -483,9 +488,10 @@ public interface DeviceAgentService {
"Server error occurred while retrieving information requested device.", "Server error occurred while retrieving information requested device.",
response = ErrorResponse.class) response = ErrorResponse.class)
}) })
Response getNextPendingOperation(@ApiParam(name = "type", value = "The device type, such as ios, android or windows.", required = true) Response getNextPendingOperation(@ApiParam(name = "type", value = "The device type, such as ios, android, or " +
"windows.", required = true)
@PathParam("type") String type, @PathParam("type") String type,
@ApiParam(name = "id", value = "The device id.", required = true) @ApiParam(name = "id", value = "The device ID.", required = true)
@PathParam("id") String deviceId); @PathParam("id") String deviceId);
@PUT @PUT
@ -494,7 +500,7 @@ public interface DeviceAgentService {
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
consumes = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON,
httpMethod = "PUT", httpMethod = "PUT",
value = "Update Operation", value = "Updating an Operation",
notes = "Update the Operations.", notes = "Update the Operations.",
tags = "Device Agent Management", tags = "Device Agent Management",
extensions = { extensions = {
@ -539,11 +545,12 @@ public interface DeviceAgentService {
"Server error occurred while retrieving information requested device.", "Server error occurred while retrieving information requested device.",
response = ErrorResponse.class) response = ErrorResponse.class)
}) })
Response updateOperation(@ApiParam(name = "type", value = "The device type, such as ios, android or windows.", required = true) Response updateOperation(@ApiParam(name = "type", value = "The device type, such as ios, android, or windows.",
required = true)
@PathParam("type") String type, @PathParam("type") String type,
@ApiParam(name = "id", value = "The device id.", required = true) @ApiParam(name = "id", value = "The device ID.", required = true)
@PathParam("id") String deviceId, @PathParam("id") String deviceId,
@ApiParam(name = "operation", value = "Operation object with data.", required = true) @ApiParam(name = "operation", value = "Update the operation object with data.", required = true)
@Valid Operation operation); @Valid Operation operation);
@PUT @PUT
@ -552,7 +559,7 @@ public interface DeviceAgentService {
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
consumes = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON,
httpMethod = "PUT", httpMethod = "PUT",
value = "Update Properties", value = "Updating Device Properties",
notes = "Update device properties.", notes = "Update device properties.",
tags = "Device Agent Management", tags = "Device Agent Management",
extensions = { extensions = {
@ -597,11 +604,12 @@ public interface DeviceAgentService {
"Server error occurred while retrieving information requested device.", "Server error occurred while retrieving information requested device.",
response = ErrorResponse.class) response = ErrorResponse.class)
}) })
Response updateDeviceProperties(@ApiParam(name = "type", value = "The device type, such as ios, android or windows.", required = true) Response updateDeviceProperties(@ApiParam(name = "type", value = "The device type, such as ios, android, or " +
"windows.", required = true)
@PathParam("type") String type, @PathParam("type") String type,
@ApiParam(name = "id", value = "The device id.", required = true) @ApiParam(name = "id", value = "The device ID.", required = true)
@PathParam("id") String deviceId, @PathParam("id") String deviceId,
@ApiParam(name = "properties", value = "device properties list.", required = true) @ApiParam(name = "properties", value = "The device properties list.", required = true)
@Valid List<Device.Property> properties); @Valid List<Device.Property> properties);
@GET @GET
@ -610,8 +618,9 @@ public interface DeviceAgentService {
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
consumes = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON,
httpMethod = "GET", httpMethod = "GET",
value = "Get pending operation of the given device", value = "Getting Specific Operations of a Device",
notes = "Returns the Operations.", notes = "Device operations can be in the IN_PROGRESS, PENDING, COMPLETED, ERROR, or REPEATED status. " +
"You can use this API to get a list of all the operations that are in a specific status for a given device.",
tags = "Device Agent Management", tags = "Device Agent Management",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {
@ -656,9 +665,10 @@ public interface DeviceAgentService {
"Server error occurred while retrieving information requested device.", "Server error occurred while retrieving information requested device.",
response = ErrorResponse.class) response = ErrorResponse.class)
}) })
Response getOperationsByDeviceAndStatus(@ApiParam(name = "type", value = "The device type, such as ios, android or windows.", required = true) Response getOperationsByDeviceAndStatus(@ApiParam(name = "type", value = "The device type, such as ios, android," +
" or windows.", required = true)
@PathParam("type") String type, @PathParam("type") String type,
@ApiParam(name = "id", value = "The device id.", required = true) @ApiParam(name = "id", value = "The device ID.", required = true)
@PathParam("id") String deviceId, @PathParam("id") String deviceId,
@ApiParam(name = "status", value = "status of the operation.", required = true) @ApiParam(name = "status", value = "status of the operation.", required = true)
@QueryParam("status")Operation.Status status); @QueryParam("status")Operation.Status status);

View File

@ -77,8 +77,8 @@ public interface DeviceEventManagementService {
@ApiOperation( @ApiOperation(
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = "POST", httpMethod = "POST",
value = "Add Event Type Defnition", value = "Adding the Event Type Definition",
notes = "Add the event definition for the device.", notes = "Add the event definition for a device.",
tags = "Device Event Management", tags = "Device Event Management",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {
@ -120,9 +120,11 @@ public interface DeviceEventManagementService {
response = ErrorResponse.class) response = ErrorResponse.class)
} }
) )
Response deployDeviceTypeEventDefinition(@ApiParam(name = "type", value = "name of the device type", required = false) Response deployDeviceTypeEventDefinition(@ApiParam(name = "type", value = "The device type, such as android, ios," +
" and windows.", required = false)
@PathParam("type")String deviceType, @PathParam("type")String deviceType,
@ApiParam(name = "deviceTypeEvent", value = "DeviceTypeEvent object with data.", required = true) @ApiParam(name = "deviceTypeEvent", value = "Add the data to complete " +
"the DeviceTypeEvent object.", required = true)
@Valid DeviceTypeEvent deviceTypeEvent); @Valid DeviceTypeEvent deviceTypeEvent);
@DELETE @DELETE
@ -130,8 +132,8 @@ public interface DeviceEventManagementService {
@ApiOperation( @ApiOperation(
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = "DELETE", httpMethod = "DELETE",
value = "Delete Event Type Defnition", value = "Delete Event Type Definition",
notes = "Delete the event definition for the device.", notes = "Delete the event definition of a device.",
tags = "Device Event Management", tags = "Device Event Management",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {
@ -173,7 +175,8 @@ public interface DeviceEventManagementService {
response = ErrorResponse.class) response = ErrorResponse.class)
} }
) )
Response deleteDeviceTypeEventDefinitions(@ApiParam(name = "type", value = "name of the device type", required = false) Response deleteDeviceTypeEventDefinitions(@ApiParam(name = "type", value = "The device type, such as android, " +
"ios, and windows.", required = false)
@PathParam("type")String deviceType); @PathParam("type")String deviceType);
@GET @GET
@ -244,7 +247,7 @@ public interface DeviceEventManagementService {
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = "GET", httpMethod = "GET",
value = "Getting Last Known Device Events", value = "Getting Last Known Device Events",
notes = "Get the Last Known events for the device.", notes = "Get the last known events for the device.",
tags = "Device Event Management", tags = "Device Event Management",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {
@ -287,17 +290,19 @@ public interface DeviceEventManagementService {
response = ErrorResponse.class) response = ErrorResponse.class)
} }
) )
Response getLastKnownData(@ApiParam(name = "deviceId", value = "id of the device ", required = false) Response getLastKnownData(@ApiParam(name = "deviceId", value = "id of the device ", required = true)
@PathParam("deviceId") String deviceId, @PathParam("deviceId") String deviceId,
@ApiParam(name = "type", value = "name of the device type", required = false) @ApiParam(name = "type", value = "name of the device type", required = true)
@PathParam("type") String deviceType); @PathParam("type") String deviceType,
@ApiParam(name = "limit", value = "limit of the records that needs to be picked up", required = false)
@QueryParam("limit") int limit);
@GET @GET
@Path("/{type}") @Path("/{type}")
@ApiOperation( @ApiOperation(
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = "GET", httpMethod = "GET",
value = "Getting Event Type Defnition", value = "Getting Event Type Definition",
notes = "Get the event definition for the device.", notes = "Get the event definition for the device.",
tags = "Device Event Management", tags = "Device Event Management",
extensions = { extensions = {
@ -341,7 +346,8 @@ public interface DeviceEventManagementService {
response = ErrorResponse.class) response = ErrorResponse.class)
} }
) )
Response getDeviceTypeEventDefinition(@ApiParam(name = "type", value = "name of the device type", required = false) Response getDeviceTypeEventDefinition(@ApiParam(name = "type", value = "The type of the device, such as android," +
" ios, or windows.", required = false)
@PathParam("type")String deviceType) ; @PathParam("type")String deviceType) ;
} }

View File

@ -208,13 +208,13 @@ public interface DeviceManagementService {
Response getDevices( Response getDevices(
@ApiParam( @ApiParam(
name = "name", name = "name",
value = "The device name, such as shamu, bullhead or angler Nexus device names. ", value = "The device name. For example, Nexus devices can have names, suhc as shamu, bullhead or angler.",
required = false) required = false)
@Size(max = 45) @Size(max = 45)
String name, String name,
@ApiParam( @ApiParam(
name = "type", name = "type",
value = "The device type, such as ios, android or windows.", value = "The device type, such as ios, android, or windows.",
required = false) required = false)
@QueryParam("type") @QueryParam("type")
@Size(max = 45) @Size(max = 45)
@ -227,7 +227,7 @@ public interface DeviceManagementService {
String user, String user,
@ApiParam( @ApiParam(
name = "userPattern", name = "userPattern",
value = "The pattern of username of the owner of the device.", value = "Define a few letters of the username in the order they appear. For example, you want to get the devices that belong to the admin, you can give \\\"ad\\\" or \\\"min\\\" here and you will get the devices that are enrolled under a user who has the given combination as part of the username .",
required = false) required = false)
@QueryParam("userPattern") @QueryParam("userPattern")
String userPattern, String userPattern,
@ -303,8 +303,8 @@ public interface DeviceManagementService {
@ApiOperation( @ApiOperation(
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = "GET", httpMethod = "GET",
value = "Getting Details of Registered Devices owned by authenticated user", value = "Getting Details of Registered Devices Owned by an Authenticated User",
notes = "Provides details of devices enrolled by authenticated user.", notes = "Provides details of devices enrolled by authenticated users.",
tags = "Device Management", tags = "Device Management",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {
@ -460,8 +460,8 @@ public interface DeviceManagementService {
@ApiOperation( @ApiOperation(
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = "GET", httpMethod = "GET",
value = "Get device enrollment status", value = "Getting the Device Enrollment Status",
notes = "Get device enrollment status", notes = "Get the device enrollment status and the device details of the device.",
tags = "Device Management", tags = "Device Management",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {
@ -564,7 +564,7 @@ public interface DeviceManagementService {
Response getDeviceLocation( Response getDeviceLocation(
@ApiParam( @ApiParam(
name = "type", name = "type",
value = "The device type name, such as ios, android, windows or fire-alarm.", value = "The device type name, such as ios, android, windows, or fire-alarm.",
required = true) required = true)
@PathParam("type") @PathParam("type")
@Size(max = 45) @Size(max = 45)
@ -592,7 +592,7 @@ public interface DeviceManagementService {
@ApiOperation( @ApiOperation(
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = "GET", httpMethod = "GET",
value = "Getting the information of a Device", value = "Getting the Information of a Device",
notes = "Get the information of a device by specifying the device type and device identifier.", notes = "Get the information of a device by specifying the device type and device identifier.",
tags = "Device Management", tags = "Device Management",
extensions = { extensions = {
@ -641,7 +641,7 @@ public interface DeviceManagementService {
Response getDeviceInformation( Response getDeviceInformation(
@ApiParam( @ApiParam(
name = "type", name = "type",
value = "The device type name, such as ios, android, windows or fire-alarm.", value = "The device type name, such as ios, android, windows, or fire-alarm.",
required = true) required = true)
@PathParam("type") @PathParam("type")
@Size(max = 45) @Size(max = 45)
@ -670,8 +670,8 @@ public interface DeviceManagementService {
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
consumes = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON,
httpMethod = "POST", httpMethod = "POST",
value = "Update the device specified by device id", value = "Update the Displayed Name of the Device",
notes = "Returns the status of the updated device operation.", notes = "Use this API to rename a device so that it is easy for you to identify devices.",
tags = "Device Management", tags = "Device Management",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {
@ -719,12 +719,12 @@ public interface DeviceManagementService {
Response renameDevice( Response renameDevice(
@ApiParam( @ApiParam(
name = "device", name = "device",
value = "The payload containing new name for device with updated name.", value = "The payload containing the new name of the device.",
required = true) required = true)
Device device, Device device,
@ApiParam( @ApiParam(
name = "device-type", name = "device-type",
value = "The device type, such as ios, android or windows.", value = "The device type, such as ios, android, or windows.",
required = true) required = true)
@PathParam("device-type") @PathParam("device-type")
@Size(max = 45) @Size(max = 45)
@ -745,8 +745,8 @@ public interface DeviceManagementService {
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
consumes = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON,
httpMethod = "DELETE", httpMethod = "DELETE",
value = "Remove the device specified by device id", value = "Remove the Device Specified by the Device ID",
notes = "Returns the status of the deleted device operation.", notes = "Returns the status of the deleted device operation and the details of the deleted device.",
tags = "Device Management", tags = "Device Management",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {
@ -794,7 +794,7 @@ public interface DeviceManagementService {
Response deleteDevice( Response deleteDevice(
@ApiParam( @ApiParam(
name = "device-type", name = "device-type",
value = "The device type, such as ios, android or windows.", value = "The device type, such as ios, android, or windows.",
required = true) required = true)
@PathParam("device-type") @PathParam("device-type")
@Size(max = 45) @Size(max = 45)
@ -1041,7 +1041,7 @@ public interface DeviceManagementService {
Response getInstalledApplications( Response getInstalledApplications(
@ApiParam( @ApiParam(
name = "type", name = "type",
value = "The device type name, such as ios, android, windows or fire-alarm.", value = "The device type name, such as ios, android, windows, or fire-alarm.",
required = true) required = true)
@PathParam("type") @PathParam("type")
@Size(max = 45) @Size(max = 45)
@ -1190,7 +1190,7 @@ public interface DeviceManagementService {
@ApiOperation( @ApiOperation(
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = "GET", httpMethod = "GET",
value = "Get the details of the policy that is enforced on a device.", value = "Getting the Details of a Policy Enforced on a Device",
notes = "A policy is enforced on all the devices that register with WSO2 IoTS." + notes = "A policy is enforced on all the devices that register with WSO2 IoTS." +
"WSO2 IoTS filters the policies based on the device platform (device type)," + "WSO2 IoTS filters the policies based on the device platform (device type)," +
"the device ownership type, the user role or name and finally, the policy that matches these filters will be enforced on the device.", "the device ownership type, the user role or name and finally, the policy that matches these filters will be enforced on the device.",
@ -1252,14 +1252,14 @@ public interface DeviceManagementService {
Response getEffectivePolicyOfDevice( Response getEffectivePolicyOfDevice(
@ApiParam( @ApiParam(
name = "type", name = "type",
value = "The device type name, such as ios, android, windows or fire-alarm.", value = "The device type name, such as ios, android, windows, or fire-alarm.",
required = true) required = true)
@PathParam("type") @PathParam("type")
@Size(max = 45) @Size(max = 45)
String type, String type,
@ApiParam( @ApiParam(
name = "id", name = "id",
value = "The device identifier.", value = "The device ID.",
required = true) required = true)
@PathParam("id") @PathParam("id")
@Size(max = 45) @Size(max = 45)
@ -1327,8 +1327,8 @@ public interface DeviceManagementService {
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
consumes = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON,
httpMethod = "PUT", httpMethod = "PUT",
value = "Change device status by device id.", value = "Changing the Status of a Device",
notes = "Returns the status of the changed device operation.", notes = "Change the status of a device from one state to another.",
tags = "Device Management", tags = "Device Management",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {
@ -1376,21 +1376,21 @@ public interface DeviceManagementService {
Response changeDeviceStatus( Response changeDeviceStatus(
@ApiParam( @ApiParam(
name = "type", name = "type",
value = "The device type, such as ios, android or windows.", value = "The device type, such as ios, android, or windows.",
required = true) required = true)
@PathParam("type") @PathParam("type")
@Size(max = 45) @Size(max = 45)
String type, String type,
@ApiParam( @ApiParam(
name = "id", name = "id",
value = "Device id", value = "Device ID.",
required = true) required = true)
@PathParam("id") @PathParam("id")
@Size(max = 45) @Size(max = 45)
String id, String id,
@ApiParam( @ApiParam(
name = "newStatus", name = "newStatus",
value = "New status of the device.", value = "The available device statuses are CREATED, ACTIVE, INACTIVE, UNREACHABLE, UNCLAIMED, SUSPENDED, BLOCKED, REMOVED, and DISENROLLMENT_REQUESTED.",
required = true) required = true)
@QueryParam("newStatus") @QueryParam("newStatus")
EnrolmentInfo.Status newStatus); EnrolmentInfo.Status newStatus);
@ -1401,8 +1401,8 @@ public interface DeviceManagementService {
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
consumes = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON,
httpMethod = "POST", httpMethod = "POST",
value = "Add operation to set of devices for a given device type", value = "Sending an Operation to Specific Device Types",
notes = "Returns the Activity Related to the operation.", notes = "You can send an operation to a group of devices that belong to a specific device type using this API. For example, you can send a ring operation to all the enrolled Android devices.",
tags = "Device Management", tags = "Device Management",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {

View File

@ -92,8 +92,8 @@ public interface GeoLocationBasedService {
consumes = "application/json", consumes = "application/json",
produces = "application/json", produces = "application/json",
httpMethod = "GET", httpMethod = "GET",
value = "Retrieve Analytics for the device type", value = "Getting the Location Details of a Device",
notes = "", notes = "Get the location details of a device during a define time period.",
response = Response.class, response = Response.class,
tags = "Geo Service Management", tags = "Geo Service Management",
extensions = { extensions = {
@ -131,24 +131,24 @@ public interface GeoLocationBasedService {
Response getGeoDeviceStats( Response getGeoDeviceStats(
@ApiParam( @ApiParam(
name = "deviceId", name = "deviceId",
value = "The registered device Id.", value = "The device ID.",
required = true) required = true)
@PathParam("deviceId") String deviceId, @PathParam("deviceId") String deviceId,
@ApiParam( @ApiParam(
name = "device-type", name = "device-type",
value = "The device type, such as ios, android or windows.", value = "The device type, such as ios, android, or windows.",
required = true) required = true)
@PathParam("deviceType") @PathParam("deviceType")
@Size(max = 45) @Size(max = 45)
String deviceType, String deviceType,
@ApiParam( @ApiParam(
name = "from", name = "from",
value = "Get stats from what time", value = "Define the time to start getting the geo location history of the device in the Epoch or UNIX format.",
required = true) required = true)
@QueryParam("from") long from, @QueryParam("from") long from,
@ApiParam( @ApiParam(
name = "to", name = "to",
value = "Get stats up to what time", value = "Define the time to finish getting the geo location history of the device in the Epoch or UNIX format.",
required = true) required = true)
@QueryParam("to") long to); @QueryParam("to") long to);
@ -156,13 +156,13 @@ public interface GeoLocationBasedService {
* Get data to show device locations in a map * Get data to show device locations in a map
*/ */
@GET @GET
@Path("stats/deviceLocations") @Path("stats/device-locations")
@ApiOperation( @ApiOperation(
consumes = "application/json", consumes = "application/json",
produces = "application/json", produces = "application/json",
httpMethod = "GET", httpMethod = "GET",
value = "Retrieve locations of devices", value = "Getting the Devices in a Defined Geofence",
notes = "", notes = "Get the details of the devices that are within the defined geofence coordinates. The geofence you are defining is enclosed with four coordinates in the shape of a square or rectangle. This is done by defining two points of the geofence. The other two points are automatically created using the given points. You can define the zoom level or scale of the map too.",
response = Response.class, response = Response.class,
tags = "Geo Service Management", tags = "Geo Service Management",
extensions = { extensions = {
@ -198,30 +198,39 @@ public interface GeoLocationBasedService {
response = Response.class) response = Response.class)
}) })
Response getGeoDeviceLocations( Response getGeoDeviceLocations(
@ApiParam(
name = "deviceType",
value = "Optional Device type name.")
@QueryParam("deviceType") String deviceType,
@ApiParam( @ApiParam(
name = "minLat", name = "minLat",
value = "minimum latitude", value = "Define the minimum latitude of the geofence.",
required = true) required = true,
defaultValue ="79.85213577747345")
@QueryParam("minLat") double minLat, @QueryParam("minLat") double minLat,
@ApiParam( @ApiParam(
name = "maxLat", name = "maxLat",
value = "maxmimum latitude", value = "Define the maximum latitude of the geofence.",
required = true) required = true,
defaultValue ="79.85266149044037")
@QueryParam("maxLat") double maxLat, @QueryParam("maxLat") double maxLat,
@ApiParam( @ApiParam(
name = "minLong", name = "minLong",
value = "minimum longitude", value = "Define the minimum longitude of the geofence.",
required = true) required = true,
defaultValue ="6.909673257977737")
@QueryParam("minLong") double minLong, @QueryParam("minLong") double minLong,
@ApiParam( @ApiParam(
name = "maxLong", name = "maxLong",
value = "maximum longitudeude", value = "Define the maximum longitude of the geofence",
required = true) required = true,
defaultValue ="6.909673257977737")
@QueryParam("maxLong") double maxLong, @QueryParam("maxLong") double maxLong,
@ApiParam( @ApiParam(
name = "zoom", name = "zoom",
value = "zoom level", value = "Define the level to zoom or scale the map. You can define any value between 1 to 14.",
required = true) required = true,
defaultValue ="2")
@QueryParam("zoom") int zoom); @QueryParam("zoom") int zoom);
@ -233,9 +242,9 @@ public interface GeoLocationBasedService {
@ApiOperation( @ApiOperation(
consumes = "application/json", consumes = "application/json",
produces = "application/json", produces = "application/json",
httpMethod = "GET", httpMethod = "POST",
value = "Create Geo alerts for the device", value = "Retrieving a Specific Geo Alert Type from a Device",
notes = "", notes = "Retrieve a specific geo alert from a device, such as getting a speed alert that was sent to a device.",
response = Response.class, response = Response.class,
tags = "Geo Service Management", tags = "Geo Service Management",
extensions = { extensions = {
@ -274,16 +283,70 @@ public interface GeoLocationBasedService {
@Valid Alert alert, @Valid Alert alert,
@ApiParam( @ApiParam(
name = "deviceId", name = "deviceId",
value = "The registered device Id.", value = "The device ID.",
required = true) required = true)
@PathParam("deviceId") String deviceId, @PathParam("deviceId") String deviceId,
@ApiParam( @ApiParam(
name = "device-type", name = "device-type",
value = "The device type, such as ios, android or windows.", value = "The device type, such as ios, android, or windows.",
required = true) required = true)
@PathParam("deviceType") @PathParam("deviceType")
@Size(max = 45) @Size(max = 45)
String deviceType, String deviceType,
@ApiParam(
name = "alertType",
value = "The alert type, such as Within, Speed,Exit, or Stationary.",
required = true)
@PathParam("alertType") String alertType);
/**
* Create Geo alerts for geo clusters
*/
@POST
@Path("/alerts/{alertType}")
@ApiOperation(
consumes = "application/json",
produces = "application/json",
httpMethod = "POST",
value = "Create Geo alerts for geo clusters",
notes = "Creating geo alerts for cluster of devices",
response = Response.class,
tags = "Geo Service Management",
extensions = {
@Extension(properties = {
@ExtensionProperty(name = Constants.SCOPE, value = "perm:geo-service:alerts-manage")
})
}
)
@ApiResponses(value = {
@ApiResponse(
code = 200,
message = "OK.",
response = Response.class,
responseHeaders = {
@ResponseHeader(
name = "Content-Type",
description = "The content type of the body")
}),
@ApiResponse(
code = 400,
message = "Bad Request. \n A geo alert with this name already exists.",
response = Response.class),
@ApiResponse(
code = 401,
message = "Unauthorized. \n Unauthorized request."),
@ApiResponse(
code = 500,
message = "Internal Server Error. \n Error on retrieving stats",
response = Response.class)
})
Response createGeoAlertsForGeoClusters(
@ApiParam(
name = "alert",
value = "The alert object",
required = true)
@Valid Alert alert,
@ApiParam( @ApiParam(
name = "alertType", name = "alertType",
value = "The alert type, such as Within, Speed, Stationary", value = "The alert type, such as Within, Speed, Stationary",
@ -298,9 +361,9 @@ public interface GeoLocationBasedService {
@ApiOperation( @ApiOperation(
consumes = "application/json", consumes = "application/json",
produces = "application/json", produces = "application/json",
httpMethod = "GET", httpMethod = "PUT",
value = "Update Geo alerts for the device", value = "Updating the Geo Alerts of a Device",
notes = "", notes = "Update the a geo alert that was sent to a device.",
response = Response.class, response = Response.class,
tags = "Geo Service Management", tags = "Geo Service Management",
extensions = { extensions = {
@ -339,16 +402,69 @@ public interface GeoLocationBasedService {
@Valid Alert alert, @Valid Alert alert,
@ApiParam( @ApiParam(
name = "deviceId", name = "deviceId",
value = "The registered device Id.", value = "The device ID.",
required = true) required = true)
@PathParam("deviceId") String deviceId, @PathParam("deviceId") String deviceId,
@ApiParam( @ApiParam(
name = "device-type", name = "device-type",
value = "The device type, such as ios, android or windows.", value = "The device type, such as ios, android, or windows.",
required = true) required = true)
@PathParam("deviceType") @PathParam("deviceType")
@Size(max = 45) @Size(max = 45)
String deviceType, String deviceType,
@ApiParam(
name = "alertType",
value = "The alert type, such as Within, Speed, Exit, or Stationary",
required = true)
@PathParam("alertType") String alertType);
/**
* Update Geo alerts for geo clusters
*/
@PUT
@Path("alerts/{alertType}")
@ApiOperation(
consumes = "application/json",
produces = "application/json",
httpMethod = "GET",
value = "Update Geo alerts for geo clusters",
notes = "Updating an existing geo alert that was defined for geo clusters",
response = Response.class,
tags = "Geo Service Management",
extensions = {
@Extension(properties = {
@ExtensionProperty(name = Constants.SCOPE, value = "perm:geo-service:alerts-manage")
})
}
)
@ApiResponses(value = {
@ApiResponse(
code = 200,
message = "OK.",
response = Response.class,
responseHeaders = {
@ResponseHeader(
name = "Content-Type",
description = "The content type of the body")
}),
@ApiResponse(
code = 400,
message = "Bad Request. \n Invalid Device Identifiers found.",
response = Response.class),
@ApiResponse(
code = 401,
message = "Unauthorized. \n Unauthorized request."),
@ApiResponse(
code = 500,
message = "Internal Server Error. \n Error on retrieving stats",
response = Response.class)
})
Response updateGeoAlertsForGeoClusters(
@ApiParam(
name = "alert",
value = "The alert object",
required = true)
@Valid Alert alert,
@ApiParam( @ApiParam(
name = "alertType", name = "alertType",
value = "The alert type, such as Within, Speed, Stationary", value = "The alert type, such as Within, Speed, Stationary",
@ -364,8 +480,8 @@ public interface GeoLocationBasedService {
consumes = "application/json", consumes = "application/json",
produces = "application/json", produces = "application/json",
httpMethod = "GET", httpMethod = "GET",
value = "Retrieve Geo alerts for the device", value = "Getting a Geo Alert from a Device",
notes = "", notes = "Retrieve a specific geo alert from a device, such as getting a speed alert that was sent to a device.",
response = Response.class, response = Response.class,
tags = "Geo Service Management", tags = "Geo Service Management",
extensions = { extensions = {
@ -403,22 +519,75 @@ public interface GeoLocationBasedService {
Response getGeoAlerts( Response getGeoAlerts(
@ApiParam( @ApiParam(
name = "deviceId", name = "deviceId",
value = "The registered device Id.", value = "The device ID.",
required = true) required = true)
@PathParam("deviceId") String deviceId, @PathParam("deviceId") String deviceId,
@ApiParam( @ApiParam(
name = "device-type", name = "device-type",
value = "The device type, such as ios, android or windows.", value = "The device type, such as ios, android. or windows.",
required = true) required = true)
@PathParam("deviceType") @PathParam("deviceType")
@Size(max = 45) @Size(max = 45)
String deviceType, String deviceType,
@ApiParam(
name = "alertType",
value = "The alert type, such as Within, Speed, Exit, or Stationary",
required = true)
@PathParam("alertType") String alertType);
/**
* Retrieve Geo alerts for geo clusters
*/
@GET
@Path("alerts/{alertType}")
@ApiOperation(
consumes = "application/json",
produces = "application/json",
httpMethod = "GET",
value = "Retrieve Geo alerts for geo clusters",
notes = "Retrieve all the defined alerts for a specific alert type",
response = Response.class,
tags = "Geo Service Management",
extensions = {
@Extension(properties = {
@ExtensionProperty(name = Constants.SCOPE, value = "perm:geo-service:alerts-manage")
})
}
)
@ApiResponses(value = {
@ApiResponse(
code = 200,
message = "OK.",
response = Response.class,
responseHeaders = {
@ResponseHeader(
name = "Content-Type",
description = "The content type of the body"),
@ResponseHeader(
name = "Last-Modified",
description = "Date and time the resource was last modified.\n" +
"Used by caches, or in conditional requests.")
}),
@ApiResponse(
code = 400,
message = "Bad Request. \n Invalid Device Identifiers found.",
response = Response.class),
@ApiResponse(
code = 401,
message = "Unauthorized. \n Unauthorized request."),
@ApiResponse(
code = 500,
message = "Internal Server Error. \n Error on retrieving stats",
response = Response.class)
})
Response getGeoAlertsForGeoClusters(
@ApiParam( @ApiParam(
name = "alertType", name = "alertType",
value = "The alert type, such as Within, Speed, Stationary", value = "The alert type, such as Within, Speed, Stationary",
required = true) required = true)
@PathParam("alertType") String alertType); @PathParam("alertType") String alertType);
/** /**
* Retrieve Geo alerts history * Retrieve Geo alerts history
*/ */
@ -428,8 +597,8 @@ public interface GeoLocationBasedService {
consumes = "application/json", consumes = "application/json",
produces = "application/json", produces = "application/json",
httpMethod = "GET", httpMethod = "GET",
value = "Retrieve Geo alerts history for the device", value = "Getting the Geo Service Alert History of a Device",
notes = "", notes = "Get the geo alert history of a device during the defined time period.",
response = Response.class, response = Response.class,
tags = "Geo Service Management", tags = "Geo Service Management",
extensions = { extensions = {
@ -467,16 +636,73 @@ public interface GeoLocationBasedService {
Response getGeoAlertsHistory( Response getGeoAlertsHistory(
@ApiParam( @ApiParam(
name = "deviceId", name = "deviceId",
value = "The registered device Id.", value = "The device ID.",
required = true) required = true)
@PathParam("deviceId") String deviceId, @PathParam("deviceId") String deviceId,
@ApiParam( @ApiParam(
name = "device-type", name = "device-type",
value = "The device type, such as ios, android or windows.", value = "The device type, such as ios, android, or windows.",
required = true) required = true)
@PathParam("deviceType") @PathParam("deviceType")
@Size(max = 45) @Size(max = 45)
String deviceType, String deviceType,
@ApiParam(
name = "from",
value = "Define the time to start getting the geo location history of the device in the Epoch or UNIX format.",
required = true)
@QueryParam("from") long from,
@ApiParam(
name = "to",
value = "Define the time to finish getting the geo location history of the device in the Epoch or UNIX format.",
required = true)
@QueryParam("to") long to);
/**
* Retrieve Geo alerts history for geo clusters
*/
@GET
@Path("alerts/history")
@ApiOperation(
consumes = "application/json",
produces = "application/json",
httpMethod = "GET",
value = "Retrieve Geo alerts history for geo clusters",
notes = "Retrieving geo alert history of all defined alerts for geo clusters",
response = Response.class,
tags = "Geo Service Management",
extensions = {
@Extension(properties = {
@ExtensionProperty(name = Constants.SCOPE, value = "perm:geo-service:alerts-manage")
})
}
)
@ApiResponses(value = {
@ApiResponse(
code = 200,
message = "OK.",
response = Response.class,
responseHeaders = {
@ResponseHeader(
name = "Content-Type",
description = "The content type of the body"),
@ResponseHeader(
name = "Last-Modified",
description = "Date and time the resource was last modified.\n" +
"Used by caches, or in conditional requests.")
}),
@ApiResponse(
code = 400,
message = "Bad Request. \n Invalid Device Identifiers found.",
response = Response.class),
@ApiResponse(
code = 401,
message = "Unauthorized. \n Unauthorized request."),
@ApiResponse(
code = 500,
message = "Internal Server Error. \n Error on retrieving stats",
response = Response.class)
})
Response getGeoAlertsHistoryForGeoClusters(
@ApiParam( @ApiParam(
name = "from", name = "from",
value = "Get stats from what time", value = "Get stats from what time",
@ -488,14 +714,19 @@ public interface GeoLocationBasedService {
required = true) required = true)
@QueryParam("to") long to); @QueryParam("to") long to);
/**
* Remove geo alerts
*/
@DELETE @DELETE
@Path("alerts/{alertType}/{deviceType}/{deviceId}") @Path("alerts/{alertType}/{deviceType}/{deviceId}")
@ApiOperation( @ApiOperation(
consumes = "application/json", consumes = "application/json",
produces = "application/json", produces = "application/json",
httpMethod = "DELETE", httpMethod = "DELETE",
value = "Deletes Geo alerts for the device", value = "Deleting a Geo Alert from a Device",
notes = "", notes = "Delete a specific geo alert from a device, such as deleting a speed alert that was sent to the device.",
response = Response.class, response = Response.class,
tags = "Geo Service Management", tags = "Geo Service Management",
extensions = { extensions = {
@ -529,14 +760,69 @@ public interface GeoLocationBasedService {
Response removeGeoAlerts( Response removeGeoAlerts(
@ApiParam( @ApiParam(
name = "deviceId", name = "deviceId",
value = "The registered device Id.", value = "The device ID.",
required = true) required = true)
@PathParam("deviceId") String deviceId, @PathParam("deviceId") String deviceId,
@ApiParam( @ApiParam(
name = "deviceType", name = "deviceType",
value = "The device type, such as ios, android or windows.", value = "The device type, such as ios, android, or windows.",
required = true) required = true)
@PathParam("deviceType") String deviceType, @PathParam("deviceType") String deviceType,
@ApiParam(
name = "alertType",
value = "The alert type, such as Within, Speed, Exit, or Stationary",
required = true)
@PathParam("alertType") String alertType,
@ApiParam(
name = "queryName",
value = "When you define a geofence you define a fence name for it. That name needs to be defined" +
" here.",
required = true)
@QueryParam("queryName") String queryName);
/**
* Remove geo alerts for geo clusters
*/
@DELETE
@Path("alerts/{alertType}")
@ApiOperation(
consumes = "application/json",
produces = "application/json",
httpMethod = "DELETE",
value = "Deletes Geo alerts for geo clusters",
notes = "Deleting any type of a geo alert that was defined for geo clusters",
response = Response.class,
tags = "Geo Service Management",
extensions = {
@Extension(properties = {
@ExtensionProperty(name = Constants.SCOPE, value = "perm:geo-service:alerts-manage")
})
}
)
@ApiResponses(value = {
@ApiResponse(
code = 200,
message = "OK.",
response = Response.class,
responseHeaders = {
@ResponseHeader(
name = "Content-Type",
description = "The content type of the body")
}),
@ApiResponse(
code = 400,
message = "Bad Request. \n Invalid Device Identifiers found.",
response = Response.class),
@ApiResponse(
code = 401,
message = "Unauthorized. \n Unauthorized request."),
@ApiResponse(
code = 500,
message = "Internal Server Error. \n Error on retrieving stats",
response = Response.class)
})
Response removeGeoAlertsForGeoClusters(
@ApiParam( @ApiParam(
name = "alertType", name = "alertType",
value = "The alert type, such as Within, Speed, Stationary", value = "The alert type, such as Within, Speed, Stationary",

View File

@ -175,8 +175,8 @@ public interface GroupManagementService {
@ApiOperation( @ApiOperation(
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = HTTPConstants.HEADER_GET, httpMethod = HTTPConstants.HEADER_GET,
value = "Get the list of groups belongs to current user.", value = "Getting the List of Groups",
notes = "Returns all permitted groups enrolled with the system.", notes = "Returns all groups enrolled with the system.",
tags = "Device Group Management", tags = "Device Group Management",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {
@ -230,7 +230,8 @@ public interface GroupManagementService {
int offset, int offset,
@ApiParam( @ApiParam(
name = "limit", name = "limit",
value = "Provide how many device details you require from the starting pagination index/offset.", value = "Provide how many device details you require from the starting pagination " +
"index/offset.",
defaultValue = "5") defaultValue = "5")
@QueryParam("limit") @QueryParam("limit")
int limit); int limit);
@ -240,8 +241,8 @@ public interface GroupManagementService {
@ApiOperation( @ApiOperation(
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = HTTPConstants.HEADER_GET, httpMethod = HTTPConstants.HEADER_GET,
value = "Get the count of groups belongs to current user.", value = "Getting the Number of Device Groups",
notes = "Returns count of all permitted groups enrolled with the system.", notes = "Get the number of device groups in the server that the current signed in user can access.",
tags = "Device Group Management", tags = "Device Group Management",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {
@ -284,8 +285,8 @@ public interface GroupManagementService {
@ApiOperation( @ApiOperation(
consumes = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON,
httpMethod = HTTPConstants.HEADER_POST, httpMethod = HTTPConstants.HEADER_POST,
value = "Add new device group to the system.", value = "Adding a New Device Group",
notes = "Add device group with current user as the owner.", notes = "Add device group with the current user as the owner.",
tags = "Device Group Management", tags = "Device Group Management",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {
@ -311,13 +312,14 @@ public interface GroupManagementService {
"Used by caches, or in conditional requests."), "Used by caches, or in conditional requests."),
@ResponseHeader( @ResponseHeader(
name = "Last-Modified", name = "Last-Modified",
description = "Date and time the resource has been modified the last time.\n" + description = "Date and time the resource has been modified the last time" +
"Used by caches, or in conditional requests.") ".\n" + "Used by caches, or in conditional requests.")
} }
), ),
@ApiResponse( @ApiResponse(
code = 303, code = 303,
message = "See Other. \n Source can be retrieved from the URL specified at the Location header.", message = "See Other. \n Source can be retrieved from the URL specified at the Location " +
"header.",
responseHeaders = { responseHeaders = {
@ResponseHeader( @ResponseHeader(
name = "Content-Location", name = "Content-Location",
@ -332,7 +334,8 @@ public interface GroupManagementService {
response = ErrorResponse.class), response = ErrorResponse.class),
@ApiResponse( @ApiResponse(
code = 415, code = 415,
message = "Unsupported media type. \n The entity of the request was in a not supported format."), message = "Unsupported media type. \n The entity of the request was in a not supported " +
"format."),
@ApiResponse( @ApiResponse(
code = 500, code = 500,
message = "Internal Server Error. \n " + message = "Internal Server Error. \n " +
@ -341,7 +344,7 @@ public interface GroupManagementService {
}) })
Response createGroup(@ApiParam( Response createGroup(@ApiParam(
name = "group", name = "group",
value = "Group object with data.", value = "Define the group object with data.",
required = true) required = true)
@Valid DeviceGroup group); @Valid DeviceGroup group);
@ -350,8 +353,8 @@ public interface GroupManagementService {
@ApiOperation( @ApiOperation(
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = HTTPConstants.HEADER_GET, httpMethod = HTTPConstants.HEADER_GET,
value = "View group specified.", value = "Getting Details of a Specific Device Group",
notes = "Returns details of group enrolled with the system.", notes = "Get the details of a specific device group.",
tags = "Device Group Management", tags = "Device Group Management",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {
@ -393,7 +396,7 @@ public interface GroupManagementService {
}) })
Response getGroup(@ApiParam( Response getGroup(@ApiParam(
name = "groupId", name = "groupId",
value = "ID of the group to view.", value = "The ID of the group.",
required = true) required = true)
@PathParam("groupId") int groupId); @PathParam("groupId") int groupId);
@ -402,9 +405,8 @@ public interface GroupManagementService {
@ApiOperation( @ApiOperation(
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = HTTPConstants.HEADER_PUT, httpMethod = HTTPConstants.HEADER_PUT,
value = "Update a group.", value = "Updating a Device Group",
notes = "If you wish to make changes to an existing group, that can be done by updating the group using " + notes = "If you wish to make changes to an existing group, that can be done by updating the group using this API",
"this resource.",
tags = "Device Group Management", tags = "Device Group Management",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {
@ -450,7 +452,7 @@ public interface GroupManagementService {
@PathParam("groupId") int groupId, @PathParam("groupId") int groupId,
@ApiParam( @ApiParam(
name = "group", name = "group",
value = "Group object with data.", value = "Update the content of the group object.",
required = true) required = true)
@Valid DeviceGroup deviceGroup); @Valid DeviceGroup deviceGroup);
@ -459,9 +461,8 @@ public interface GroupManagementService {
@ApiOperation( @ApiOperation(
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = HTTPConstants.HEADER_DELETE, httpMethod = HTTPConstants.HEADER_DELETE,
value = "Delete a group.", value = "Deleting a Group",
notes = "If you wish to remove an existing group, that can be done by updating the group using " + notes = "If you wish to remove an existing group, that can be done by updating the group using this API.",
"this resource.",
tags = "Device Group Management", tags = "Device Group Management",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {
@ -511,9 +512,9 @@ public interface GroupManagementService {
@ApiOperation( @ApiOperation(
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = HTTPConstants.HEADER_POST, httpMethod = HTTPConstants.HEADER_POST,
value = "Manage group sharing with a user.", value = "Sharing a Group",
notes = "If you wish to share /un share an existing group with a user under defined sharing roles, " + notes = "A device group can be shared with different user-roles. The users that belong to that role can " +
"that can be done using this resource.", "then view the groups and the devices in it. Use this API to share a group among user roles.",
tags = "Device Group Management", tags = "Device Group Management",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {
@ -568,8 +569,9 @@ public interface GroupManagementService {
@ApiOperation( @ApiOperation(
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = HTTPConstants.HEADER_GET, httpMethod = HTTPConstants.HEADER_GET,
value = "View list of roles of a device group.", value = "Getting the List of Roles the Group is Shared With",
notes = "Returns details of roles which particular group has been shared with.", notes = "A device group can be shared with different user-roles. The users that belong to that role can" +
"then view the groups and the devices in it. Using this API you get the list of roles the device group is shared with.",
tags = "Device Group Management", tags = "Device Group Management",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {
@ -620,8 +622,8 @@ public interface GroupManagementService {
@ApiOperation( @ApiOperation(
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = HTTPConstants.HEADER_GET, httpMethod = HTTPConstants.HEADER_GET,
value = "View list of devices in the device group.", value = "Getting the List of Devices in a Group",
notes = "Returns list of devices in the device group.", notes = "Returns the list of devices in a device group.",
tags = "Device Group Management", tags = "Device Group Management",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {
@ -675,7 +677,8 @@ public interface GroupManagementService {
int offset, int offset,
@ApiParam( @ApiParam(
name = "limit", name = "limit",
value = "Provide how many device details you require from the starting pagination index/offset.", value = "Provide how many group details you require from the starting " +
"pagination index/offset.",
defaultValue = "5") defaultValue = "5")
@QueryParam("limit") @QueryParam("limit")
int limit); int limit);
@ -685,8 +688,8 @@ public interface GroupManagementService {
@ApiOperation( @ApiOperation(
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = HTTPConstants.HEADER_GET, httpMethod = HTTPConstants.HEADER_GET,
value = "View list of device count in the device group.", value = "Getting the Number of Devices in a Group",
notes = "Returns device count in the device group.", notes = "Get the number of devices in a group using this API.",
tags = "Device Group Management", tags = "Device Group Management",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {
@ -737,8 +740,8 @@ public interface GroupManagementService {
@ApiOperation( @ApiOperation(
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = HTTPConstants.HEADER_POST, httpMethod = HTTPConstants.HEADER_POST,
value = "Add devices to group.", value = "Adding Devices to a Group",
notes = "Add existing devices to the device group.", notes = "Add the enrolled devices to a group.",
tags = "Device Group Management", tags = "Device Group Management",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {
@ -793,8 +796,8 @@ public interface GroupManagementService {
@ApiOperation( @ApiOperation(
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = HTTPConstants.HEADER_DELETE, httpMethod = HTTPConstants.HEADER_DELETE,
value = "Remove devices from group.", value = "Removing Devices from a Group",
notes = "Remove existing devices from the device group.", notes = "Remove a device from a group using this API.",
tags = "Device Group Management", tags = "Device Group Management",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {
@ -840,7 +843,8 @@ public interface GroupManagementService {
@PathParam("groupId") int groupId, @PathParam("groupId") int groupId,
@ApiParam( @ApiParam(
name = "deviceIdentifiers", name = "deviceIdentifiers",
value = "Device identifiers of the devices which needed to be removed.", value = "The device identifiers of the devices that needed to be removed."+
" You can define many device IDs as comma separated values.",
required = true) required = true)
@Valid List<DeviceIdentifier> deviceIdentifiers); @Valid List<DeviceIdentifier> deviceIdentifiers);
@ -849,8 +853,8 @@ public interface GroupManagementService {
@ApiOperation( @ApiOperation(
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = HTTPConstants.HEADER_POST, httpMethod = HTTPConstants.HEADER_POST,
value = "Assign devices to groups", value = "Adding a Device to Many Groups",
notes = "Add existing device to device groups.", notes = "Add an already enrolled device to many groups, using this API.",
tags = "Device Group Management", tags = "Device Group Management",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {
@ -892,7 +896,9 @@ public interface GroupManagementService {
Response updateDeviceAssigningToGroups( Response updateDeviceAssigningToGroups(
@ApiParam( @ApiParam(
name = "deviceToGroupsAssignment", name = "deviceToGroupsAssignment",
value = "Device to groups assignment", value = "In the payload, define the group IDs that you need to add the device to as comma " +
"separated values, and the device identifier and type of the device, such as android, " +
"ios, and windows, that needs to be added to the groups.",
required = true) required = true)
@Valid DeviceToGroupsAssignment deviceToGroupsAssignment); @Valid DeviceToGroupsAssignment deviceToGroupsAssignment);
@ -901,8 +907,9 @@ public interface GroupManagementService {
@ApiOperation( @ApiOperation(
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = HTTPConstants.HEADER_GET, httpMethod = HTTPConstants.HEADER_GET,
value = "List of groups that have the device", value = "Getting Device Groups that Include the Specific Device",
notes = "List of groups that have the device.", notes = " device can be added to one or many groups. This API gives you the list of groups the device " +
"has been added to.",
tags = "Device Group Management", tags = "Device Group Management",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {
@ -940,13 +947,13 @@ public interface GroupManagementService {
Response getGroups( Response getGroups(
@ApiParam( @ApiParam(
name = "deviceId", name = "deviceId",
value = "Id of the device.", value = "The device ID.",
required = true) required = true)
@QueryParam("deviceId") @QueryParam("deviceId")
String deviceId, String deviceId,
@ApiParam( @ApiParam(
name = "deviceType", name = "deviceType",
value = "Type of the device.", value = "The type of the device, such as android, ios, or windows.",
required = true) required = true)
@QueryParam("deviceType") @QueryParam("deviceType")
String deviceType); String deviceType);

View File

@ -18,17 +18,17 @@
*/ */
package org.wso2.carbon.device.mgt.jaxrs.service.api; package org.wso2.carbon.device.mgt.jaxrs.service.api;
import io.swagger.annotations.SwaggerDefinition;
import io.swagger.annotations.Info;
import io.swagger.annotations.ExtensionProperty;
import io.swagger.annotations.Extension;
import io.swagger.annotations.Tag;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses; import io.swagger.annotations.ApiResponses;
import io.swagger.annotations.Extension;
import io.swagger.annotations.ExtensionProperty;
import io.swagger.annotations.Info;
import io.swagger.annotations.ResponseHeader; import io.swagger.annotations.ResponseHeader;
import io.swagger.annotations.SwaggerDefinition;
import io.swagger.annotations.Tag;
import org.wso2.carbon.apimgt.annotations.api.Scope; import org.wso2.carbon.apimgt.annotations.api.Scope;
import org.wso2.carbon.apimgt.annotations.api.Scopes; import org.wso2.carbon.apimgt.annotations.api.Scopes;
import org.wso2.carbon.device.mgt.common.notification.mgt.Notification; import org.wso2.carbon.device.mgt.common.notification.mgt.Notification;
@ -36,9 +36,15 @@ import org.wso2.carbon.device.mgt.jaxrs.NotificationList;
import org.wso2.carbon.device.mgt.jaxrs.beans.ErrorResponse; import org.wso2.carbon.device.mgt.jaxrs.beans.ErrorResponse;
import org.wso2.carbon.device.mgt.jaxrs.util.Constants; import org.wso2.carbon.device.mgt.jaxrs.util.Constants;
import javax.validation.constraints.Max;
import javax.validation.constraints.Size; import javax.validation.constraints.Size;
import javax.ws.rs.*; import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.HeaderParam;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
@ -207,8 +213,7 @@ public interface NotificationManagementService {
value = "The notification ID.", value = "The notification ID.",
required = true, required = true,
defaultValue = "1") defaultValue = "1")
@PathParam("id") @Max(45) @PathParam("id") int id);
int id);
@PUT @PUT
@ -216,9 +221,9 @@ public interface NotificationManagementService {
@ApiOperation( @ApiOperation(
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = "PUT", httpMethod = "PUT",
value = "Clear all notifications", value = "Clearing All Notifications",
notes = "When a user needs to mark all the notifications as checked/read this " + notes = "When a user needs to mark all the notifications as checked/read this " +
"function can be used to clear all notifications", "function can be used to clear all notifications.",
tags = "Device Notification Management", tags = "Device Notification Management",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {

View File

@ -136,7 +136,8 @@ import java.util.List;
) )
} }
) )
@Api(value = "Device Policy Management", description = "This API includes the functionality around device policy management") @Api(value = "Device Policy Management", description = "This API includes the functionality around device policy " +
"management")
@Path("/policies") @Path("/policies")
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON)
@ -148,8 +149,10 @@ public interface PolicyManagementService {
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = "POST", httpMethod = "POST",
value = "Adding a Policy", value = "Adding a Policy",
notes = "Add a policy using this REST API command. When adding a policy you will have the option of saving the policy or saving and publishing the policy." + notes = "Add a policy using this REST API command. When adding a policy you will have the option of " +
"Using this REST API you are able to save a created Policy and this policy will be in the inactive state.", "saving the policy or saving and publishing the policy." +
"Using this REST API you are able to save a created Policy and this policy will be in the " +
"inactive state.",
tags = "Device Policy Management", tags = "Device Policy Management",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {
@ -181,7 +184,8 @@ public interface PolicyManagementService {
), ),
@ApiResponse( @ApiResponse(
code = 303, code = 303,
message = "See Other. \n The source can be retrieved from the URL specified in the location header", message = "See Other. \n The source can be retrieved from the URL specified in the " +
"location header",
responseHeaders = { responseHeaders = {
@ResponseHeader( @ResponseHeader(
name = "Content-Location", name = "Content-Location",
@ -192,11 +196,13 @@ public interface PolicyManagementService {
response = ErrorResponse.class), response = ErrorResponse.class),
@ApiResponse( @ApiResponse(
code = 401, code = 401,
message = "Not Found. \n The user that is currently logged in is not authorized to add policies.", message = "Not Found. \n The user that is currently logged in is not authorized to add " +
"policies.",
response = ErrorResponse.class), response = ErrorResponse.class),
@ApiResponse( @ApiResponse(
code = 415, code = 415,
message = "Unsupported media type. \n The format of the requested entity was not supported."), message = "Unsupported media type. \n The format of the requested entity was not " +
"supported."),
@ApiResponse( @ApiResponse(
code = 500, code = 500,
message = "Internal Server Error. \n " + message = "Internal Server Error. \n " +
@ -248,7 +254,8 @@ public interface PolicyManagementService {
), ),
@ApiResponse( @ApiResponse(
code = 304, code = 304,
message = "Not Modified. \n Empty body because the client already has the latest version of the requested resource."), message = "Not Modified. \n Empty body because the client already has the latest version " +
"of the requested resource."),
@ApiResponse( @ApiResponse(
code = 400, code = 400,
message = "Bad Request. \n Invalid request or validation error.", message = "Bad Request. \n Invalid request or validation error.",
@ -322,7 +329,8 @@ public interface PolicyManagementService {
), ),
@ApiResponse( @ApiResponse(
code = 304, code = 304,
message = "Not Modified. \n Empty body because the client already has the latest version of the requested resource.\n"), message = "Not Modified. \n Empty body because the client already has the latest version " +
"of the requested resource.\n"),
@ApiResponse( @ApiResponse(
code = 404, code = 404,
message = "Not Found. \n A specified policy was not found.", message = "Not Found. \n A specified policy was not found.",
@ -400,7 +408,8 @@ public interface PolicyManagementService {
response = ErrorResponse.class), response = ErrorResponse.class),
@ApiResponse( @ApiResponse(
code = 415, code = 415,
message = "Unsupported media type. \n The format of the requested entity was not supported."), message = "Unsupported media type. \n The format of the requested entity was not " +
"supported."),
@ApiResponse( @ApiResponse(
code = 500, code = 500,
message = "Internal Server Error. \n " + message = "Internal Server Error. \n " +
@ -451,7 +460,8 @@ public interface PolicyManagementService {
response = ErrorResponse.class), response = ErrorResponse.class),
@ApiResponse( @ApiResponse(
code = 415, code = 415,
message = "Unsupported media type. \n The format of the requested entity was not supported.\n " message = "Unsupported media type. \n The format of the requested entity was not " +
"supported.\n "
+ "supported format."), + "supported format."),
@ApiResponse( @ApiResponse(
code = 500, code = 500,
@ -474,7 +484,8 @@ public interface PolicyManagementService {
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = "POST", httpMethod = "POST",
value = "Activating Policies", value = "Activating Policies",
notes = "Publish a policy using this API to bring a policy that is in the inactive state to the active state.", notes = "Publish a policy using this API to bring a policy that is in the inactive state to the active " +
"state.",
tags = "Device Policy Management", tags = "Device Policy Management",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {
@ -515,7 +526,8 @@ public interface PolicyManagementService {
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = "POST", httpMethod = "POST",
value = "Deactivating Policies", value = "Deactivating Policies",
notes = "Unpublish a policy using this API to bring a policy that is in the active state to the inactive state.", notes = "Unpublish a policy using this API to bring a policy that is in the active state to the inactive " +
"state.",
tags = "Device Policy Management", tags = "Device Policy Management",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {
@ -655,7 +667,8 @@ public interface PolicyManagementService {
), ),
@ApiResponse( @ApiResponse(
code = 304, code = 304,
message = "Not Modified. \n Empty body because the client already has the latest version of the requested resource.\n"), message = "Not Modified. \n Empty body because the client already has the latest version " +
"of the requested resource.\n"),
@ApiResponse( @ApiResponse(
code = 404, code = 404,
message = "Not Found. \n A specified policy was not found.", message = "Not Found. \n A specified policy was not found.",

View File

@ -78,8 +78,8 @@ public interface RemoteSessionService {
consumes = "application/json", consumes = "application/json",
produces = "application/json", produces = "application/json",
httpMethod = "GET", httpMethod = "GET",
value = "Retrieve Connection Information for the device type", value = "Connecting to a Device",
notes = "", notes = "You able to connect to a device to start a remote session using this API.",
response = Response.class, response = Response.class,
tags = "Remote Session Service Management", tags = "Remote Session Service Management",
extensions = { extensions = {
@ -117,12 +117,12 @@ public interface RemoteSessionService {
Response getRemoteSessionDeviceConnect( Response getRemoteSessionDeviceConnect(
@ApiParam( @ApiParam(
name = "deviceId", name = "deviceId",
value = "The registered device Id.", value = "The device ID.",
required = true) required = true)
@PathParam("deviceId") String deviceId, @PathParam("deviceId") String deviceId,
@ApiParam( @ApiParam(
name = "device-type", name = "device-type",
value = "The device type, such as ios, android or windows.", value = "The device type, such as ios, android, or windows.",
required = true) required = true)
@PathParam("deviceType") @PathParam("deviceType")
@Size(max = 45) @Size(max = 45)

View File

@ -185,7 +185,7 @@ public interface RoleManagementService {
@ApiOperation( @ApiOperation(
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = "GET", httpMethod = "GET",
value = "Getting the List of Roles filtered by the given prefix", value = "Getting the List of Roles Filtered by the Given Prefix",
notes = "WSO2 IoTS supports role-based access control (RBAC) and role management. Using this API you can the list of roles that are in WSO2 IoTS.\n" + notes = "WSO2 IoTS supports role-based access control (RBAC) and role management. Using this API you can the list of roles that are in WSO2 IoTS.\n" +
"Note: Internal roles, roles created for service-providers, and application related roles will not be given in the output.", "Note: Internal roles, roles created for service-providers, and application related roles will not be given in the output.",
tags = "Role Management", tags = "Role Management",
@ -482,7 +482,9 @@ public interface RoleManagementService {
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = "POST", httpMethod = "POST",
value = "Adding a combined Role", value = "Adding a combined Role",
notes = "WSO2 IoTS supports role-based access control (RBAC) and role management. Add a new combined role to WSO2 IoTS using this REST API.", notes = "You are able to combine two roles that already exist and create one role. For example, you " +
"might want a role that has device owner and application management role permissions, you can" +
" now select these two roles and create another new role that has all their permissions.",
tags = "Role Management", tags = "Role Management",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {
@ -511,7 +513,8 @@ public interface RoleManagementService {
"Used by caches, or in conditional requests.")}), "Used by caches, or in conditional requests.")}),
@ApiResponse( @ApiResponse(
code = 303, code = 303,
message = "See Other. \n The source can be retrieved from the URL specified in the location header.", message = "See Other. \n The source can be retrieved from the URL specified in the location " +
"header.",
responseHeaders = { responseHeaders = {
@ResponseHeader( @ResponseHeader(
name = "Content-Location", name = "Content-Location",
@ -597,7 +600,8 @@ public interface RoleManagementService {
name = "role", name = "role",
value = "The properties required to update a role.\n" + value = "The properties required to update a role.\n" +
"NOTE: Don't change the role and the permissions of the admin user. " + "NOTE: Don't change the role and the permissions of the admin user. " +
"If you want to try out this API by updating all the properties, create a new role and update the properties accordingly.", "If you want to try out this API by updating all the properties, create a new role " +
"and update the properties accordingly.",
required = true) RoleInfo role, required = true) RoleInfo role,
@ApiParam( @ApiParam(
name = "user-store", name = "user-store",
@ -608,9 +612,12 @@ public interface RoleManagementService {
@DELETE @DELETE
@Path("/{roleName}") @Path("/{roleName}")
@ApiOperation( @ApiOperation(
consumes = MediaType.APPLICATION_JSON,
produces = MediaType.APPLICATION_JSON,
httpMethod = "DELETE", httpMethod = "DELETE",
value = "Deleting a Role", value = "Deleting a Role",
notes = "Roles become obsolete over time due to various reasons. In a situation where your Organization identifies that a specific role is no longer required, you " + notes = "Roles become obsolete over time due to various reasons. In a situation where your " +
"Organization identifies that a specific role is no longer required, you " +
"can delete a role using this REST API.", "can delete a role using this REST API.",
tags = "Role Management", tags = "Role Management",
extensions = { extensions = {
@ -659,8 +666,10 @@ public interface RoleManagementService {
notes = "Defining users to a role at the point of creating a new role is optional. " + notes = "Defining users to a role at the point of creating a new role is optional. " +
"You can update the users that belong to a given role after you have created " + "You can update the users that belong to a given role after you have created " +
"a role using this REST API.\n" + "a role using this REST API.\n" +
"Example: Your Organization hires 30 new engineers. Updating the role details for each user can " + "Example: Your Organization hires 30 new engineers. Updating the role details for each user " +
"be cumbersome. Therefore, you can define all the new employees that belong to the engineering " + "can " +
"be cumbersome. Therefore, you can define all the new employees that belong to the " +
"engineering " +
"role using this API.", "role using this API.",
tags = "Role Management", tags = "Role Management",
extensions = { extensions = {
@ -684,7 +693,8 @@ public interface RoleManagementService {
"Used by caches, or in conditional requests."), "Used by caches, or in conditional requests."),
@ResponseHeader( @ResponseHeader(
name = "Last-Modified", name = "Last-Modified",
description = "Date and time the resource has been modified the last time.\n" + description = "Date and time the resource has been modified the last " +
"time.\n" +
"Used by caches, or in conditional requests.")}), "Used by caches, or in conditional requests.")}),
@ApiResponse( @ApiResponse(
code = 400, code = 400,
@ -696,7 +706,8 @@ public interface RoleManagementService {
response = ErrorResponse.class), response = ErrorResponse.class),
@ApiResponse( @ApiResponse(
code = 415, code = 415,
message = "Unsupported media type. \n The format of the requested entity was not supported.\n" + message = "Unsupported media type. \n The format of the requested entity was not " +
"supported.\n" +
"supported format.", "supported format.",
response = ErrorResponse.class), response = ErrorResponse.class),
@ApiResponse( @ApiResponse(

View File

@ -155,7 +155,8 @@ public interface UserManagementService {
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = "POST", httpMethod = "POST",
value = "Adding a User", value = "Adding a User",
notes = "WSO2 IoTS supports user management. Add a new user to the WSO2 IoTS user management system via this REST API", notes = "WSO2 IoTS supports user management. Add a new user to the WSO2 IoTS user management system via " +
"this REST API",
tags = "User Management", tags = "User Management",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {
@ -243,7 +244,8 @@ public interface UserManagementService {
}), }),
@ApiResponse( @ApiResponse(
code = 304, code = 304,
message = "Not Modified. \n Empty body because the client already has the latest version of the requested resource."), message = "Not Modified. \n Empty body because the client already has the latest version of the " +
"requested resource."),
@ApiResponse( @ApiResponse(
code = 404, code = 404,
message = "Not Found. \n The specified resource does not exist.", message = "Not Found. \n The specified resource does not exist.",
@ -351,7 +353,8 @@ public interface UserManagementService {
@ApiOperation( @ApiOperation(
httpMethod = "DELETE", httpMethod = "DELETE",
value = "Deleting a User", value = "Deleting a User",
notes = "When an employee leaves the organization, you can remove the user details from WSO2 IoTS using this REST API.", notes = "When an employee leaves the organization, you can remove the user details from WSO2 IoTS using " +
"this REST API.",
tags = "User Management", tags = "User Management",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {
@ -378,7 +381,8 @@ public interface UserManagementService {
@ApiParam( @ApiParam(
name = "username", name = "username",
value = "Username of the user to be deleted.\n" + value = "Username of the user to be deleted.\n" +
"INFO: If you want to try out this API, make sure to create a new user and then remove that user. Do not remove the admin user.", "INFO: If you want to try out this API, make sure to create a new user and then remove " +
"that user. Do not remove the admin user.",
required = true, required = true,
defaultValue = "[Create a new user named Jim, and then try out this API.]") defaultValue = "[Create a new user named Jim, and then try out this API.]")
@PathParam("username") String username, @PathParam("username") String username,
@ -394,7 +398,8 @@ public interface UserManagementService {
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = "GET", httpMethod = "GET",
value = "Getting the Role Details of a User", value = "Getting the Role Details of a User",
notes = "A user can be assigned to one or more role in IoTS. Using this REST API you can get the role/roles a user is assigned to.", notes = "A user can be assigned to one or more role in IoTS. Using this REST API you can get the " +
"role/roles a user is assigned to.",
tags = "User Management", tags = "User Management",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {
@ -422,7 +427,8 @@ public interface UserManagementService {
}), }),
@ApiResponse( @ApiResponse(
code = 304, code = 304,
message = "Not Modified. \n Empty body because the client already has the latest version of the requested resource."), message = "Not Modified. \n Empty body because the client already has the latest version of the " +
"requested resource."),
@ApiResponse( @ApiResponse(
code = 404, code = 404,
message = "Not Found. \n The specified resource does not exist.\n", message = "Not Found. \n The specified resource does not exist.\n",
@ -455,7 +461,8 @@ public interface UserManagementService {
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = "GET", httpMethod = "GET",
value = "Getting Details of Users", value = "Getting Details of Users",
notes = "You are able to manage users in WSO2 IoTS by adding, updating and removing users. If you wish to get the list of users registered with WSO2 IoTS, you can do so " notes = "You are able to manage users in WSO2 IoTS by adding, updating and removing users. If you wish to" +
" get the list of users registered with WSO2 IoTS, you can do so "
+ "using this REST API", + "using this REST API",
tags = "User Management", tags = "User Management",
extensions = { extensions = {
@ -492,7 +499,8 @@ public interface UserManagementService {
response = ErrorResponse.class), response = ErrorResponse.class),
@ApiResponse( @ApiResponse(
code = 500, code = 500,
message = "Internal Server Error. \n Server error occurred while fetching the list of WSO2 IoTS users.", message = "Internal Server Error. \n Server error occurred while fetching the list of WSO2 IoTS " +
"users.",
response = ErrorResponse.class) response = ErrorResponse.class)
}) })
Response getUsers( Response getUsers(
@ -551,7 +559,8 @@ public interface UserManagementService {
response = ErrorResponse.class), response = ErrorResponse.class),
@ApiResponse( @ApiResponse(
code = 500, code = 500,
message = "Internal Server Error. \n Server error occurred while fetching the total number of users in WSO2 IoTS.", message = "Internal Server Error. \n Server error occurred while fetching the total number of " +
"users in WSO2 IoTS.",
response = ErrorResponse.class) response = ErrorResponse.class)
}) })
Response getUserCount(); Response getUserCount();
@ -602,7 +611,8 @@ public interface UserManagementService {
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = "GET", httpMethod = "GET",
value = "Searching for a User Name", value = "Searching for a User Name",
notes = "If you are unsure of the user name of a user and need to retrieve the details of a specific user, you can " notes = "If you are unsure of the user name of a user and need to retrieve the details of a specific " +
"user, you can "
+ "search for that user by giving a character or a few characters in the username. " + "search for that user by giving a character or a few characters in the username. "
+ "You will be given a list of users having the user name in the exact order of the " + "You will be given a list of users having the user name in the exact order of the "
+ "characters you provided.", + "characters you provided.",
@ -634,14 +644,16 @@ public interface UserManagementService {
}), }),
@ApiResponse( @ApiResponse(
code = 304, code = 304,
message = "Not Modified. \n Empty body because the client already has the latest version of the requested resource."), message = "Not Modified. \n Empty body because the client already has the latest version of the " +
"requested resource."),
@ApiResponse( @ApiResponse(
code = 406, code = 406,
message = "Not Acceptable.\n The requested media type is not supported", message = "Not Acceptable.\n The requested media type is not supported",
response = ErrorResponse.class), response = ErrorResponse.class),
@ApiResponse( @ApiResponse(
code = 500, code = 500,
message = "Internal Server Error. \n Server error occurred while fetching the list of users that matched the given filter.", message = "Internal Server Error. \n Server error occurred while fetching the list of users that " +
"matched the given filter.",
response = ErrorResponse.class) response = ErrorResponse.class)
}) })
Response getUserNames( Response getUserNames(
@ -727,7 +739,9 @@ public interface UserManagementService {
httpMethod = "POST", httpMethod = "POST",
value = "Sending Enrollment Invitations to Users", value = "Sending Enrollment Invitations to Users",
notes = "Send the users a mail inviting them to enroll their devices using the REST API given below.\n" + notes = "Send the users a mail inviting them to enroll their devices using the REST API given below.\n" +
"Before running the REST API command to send the enrollment invitations to users make sure to configure WSO2 IoTS as explained in step 4, under the WSO2 IoTS general server configurations documentation.", "Before running the REST API command to send the enrollment invitations to users make sure to " +
"configure WSO2 IoTS as explained in step 4, under the WSO2 IoTS general server configurations " +
"documentation.",
tags = "User Management", tags = "User Management",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {

View File

@ -18,18 +18,11 @@
*/ */
package org.wso2.carbon.device.mgt.jaxrs.service.api.admin; package org.wso2.carbon.device.mgt.jaxrs.service.api.admin;
import io.swagger.annotations.SwaggerDefinition; import io.swagger.annotations.*;
import io.swagger.annotations.Info; import org.apache.axis2.transport.http.HTTPConstants;
import io.swagger.annotations.ExtensionProperty;
import io.swagger.annotations.Extension;
import io.swagger.annotations.Tag;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.wso2.carbon.apimgt.annotations.api.Scope; import org.wso2.carbon.apimgt.annotations.api.Scope;
import org.wso2.carbon.apimgt.annotations.api.Scopes; import org.wso2.carbon.apimgt.annotations.api.Scopes;
import org.wso2.carbon.device.mgt.common.Device;
import org.wso2.carbon.device.mgt.jaxrs.beans.ErrorResponse; import org.wso2.carbon.device.mgt.jaxrs.beans.ErrorResponse;
import org.wso2.carbon.device.mgt.jaxrs.beans.PasswordResetWrapper; import org.wso2.carbon.device.mgt.jaxrs.beans.PasswordResetWrapper;
import org.wso2.carbon.device.mgt.jaxrs.util.Constants; import org.wso2.carbon.device.mgt.jaxrs.util.Constants;
@ -61,6 +54,12 @@ import javax.ws.rs.core.Response;
description = "View Users", description = "View Users",
key = "perm:admin-users:view", key = "perm:admin-users:view",
permissions = {"/device-mgt/users/manage"} permissions = {"/device-mgt/users/manage"}
),
@Scope(
name = "Delete Users Device Information",
description = "Delete users device details",
key = "perm:admin-users:remove",
permissions = {"/device-mgt/users/manage"}
) )
} }
) )
@ -127,4 +126,136 @@ public interface UserManagementAdminService {
value = "Credential.", value = "Credential.",
required = true) PasswordResetWrapper credentials); required = true) PasswordResetWrapper credentials);
@DELETE
@Path("/{username}/devices")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@ApiOperation(
consumes = MediaType.APPLICATION_JSON,
produces = MediaType.APPLICATION_JSON,
httpMethod = HTTPConstants.HEADER_DELETE,
value = "Delete a users associated devices.",
notes = "If you wish to remove an device details to comply with the privacy requirements, can be done with " +
"this resource.",
tags = "Device details remove",
extensions = {
@Extension(properties = {
@ExtensionProperty(name = Constants.SCOPE, value = "perm:admin-users:remove")
})
}
)
@ApiResponses(value = {
@ApiResponse(code = 200, message = "OK. \n Users devices and details has been deleted successfully.",
responseHeaders = {
@ResponseHeader(
name = "Content-Type",
description = "The content type of the body."),
@ResponseHeader(
name = "ETag",
description = "Entity Tag of the response resource.\n" +
"Used by caches, or in conditional requests."),
@ResponseHeader(
name = "Last-Modified",
description = "Date and time the resource has been modified the last time.\n" +
"Used by caches, or in conditional requests."),
}),
@ApiResponse(
code = 304,
message = "Not Modified. \n Empty body because the client has already the latest version of " +
"the requested resource."),
@ApiResponse(
code = 404,
message = "Group not found.",
response = ErrorResponse.class),
@ApiResponse(
code = 406,
message = "Not Acceptable.\n The requested media type is not supported."),
@ApiResponse(
code = 500,
message = "Internal Server Error. \n Server error occurred while removing the group.",
response = ErrorResponse.class)
})
Response deleteDeviceOfUser(@ApiParam(
name = "username",
value = "Username of the users devices to be deleted.",
required = true)
@PathParam("username") String username);
//device remove request would looks like follows
//DELETE devices/type/virtual_firealarm/id/us06ww93auzp
@DELETE
@Path("/type/{device-type}/id/{device-id}")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@ApiOperation(
produces = MediaType.APPLICATION_JSON,
consumes = MediaType.APPLICATION_JSON,
httpMethod = "DELETE",
value = "Remove the information of device specified by device id",
notes = "Returns the status of the deleted device information.",
tags = "Device details remove privacy compliance",
extensions = {
@Extension(properties = {
@ExtensionProperty(name = Constants.SCOPE, value = "perm:admin-users:remove")
})
}
)
@ApiResponses(
value = {
@ApiResponse(
code = 200,
message = "OK. \n Successfully deleted the device information.",
response = Device.class,
responseHeaders = {
@ResponseHeader(
name = "Content-Type",
description = "The content type of the body"),
@ResponseHeader(
name = "ETag",
description = "Entity Tag of the response resource.\n" +
"Used by caches, or in conditional requests."),
@ResponseHeader(
name = "Last-Modified",
description = "Date and time the resource has been modified the last time.\n" +
"Used by caches, or in conditional requests."),
}),
@ApiResponse(
code = 304,
message = "Not Modified. Empty body because the client already has the latest " +
"version of the requested resource."),
@ApiResponse(
code = 400,
message = "Bad Request. \n Invalid request or validation error.",
response = ErrorResponse.class),
@ApiResponse(
code = 404,
message = "Not Found. \n No device is found under the provided type and id.",
response = ErrorResponse.class),
@ApiResponse(
code = 500,
message = "Internal Server Error. \n " +
"Server error occurred while retrieving information requested device.",
response = ErrorResponse.class)
})
Response deleteDevice(
@ApiParam(
name = "device-type",
value = "The device type, such as ios, android or windows.",
required = true)
@PathParam("device-type")
@Size(max = 45)
String deviceType,
@ApiParam(
name = "device-id",
value = "The device identifier of the device.",
required = true)
@PathParam("device-id")
@Size(max = 45)
String deviceId);
} }

View File

@ -521,7 +521,7 @@ public class DeviceAgentServiceImpl implements DeviceAgentService {
@Override @Override
@PUT @PUT
@Path("/operations/{type}/{id}") @Path("/properties/{type}/{id}")
public Response updateDeviceProperties(@PathParam("type") String type, @PathParam("id") String deviceId, public Response updateDeviceProperties(@PathParam("type") String type, @PathParam("id") String deviceId,
@Valid List<Device.Property> properties) { @Valid List<Device.Property> properties) {
try { try {
@ -542,13 +542,16 @@ public class DeviceAgentServiceImpl implements DeviceAgentService {
return Response.status(Response.Status.BAD_REQUEST).entity(msg).build(); return Response.status(Response.Status.BAD_REQUEST).entity(msg).build();
} }
DeviceMgtAPIUtils.getDeviceManagementService().updateProperties(deviceIdentifier, properties); if (DeviceMgtAPIUtils.getDeviceManagementService().updateProperties(deviceIdentifier, properties)){
return Response.status(Response.Status.ACCEPTED).entity("Device properties updated.").build();
} else {
return Response.status(Response.Status.NOT_ACCEPTABLE).entity("Device properties not updated.").build();
}
} catch (DeviceManagementException e) { } catch (DeviceManagementException e) {
String errorMessage = "Issue in retrieving device management service instance"; String errorMessage = "Issue in retrieving device management service instance";
log.error(errorMessage, e); log.error(errorMessage, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errorMessage).build(); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errorMessage).build();
} }
return null;
} }
@GET @GET

Some files were not shown because too many files have changed in this diff Show More