Adding the feature management service and android application to webapps

revert-dabc3590
Geeth Munasinghe 10 years ago
parent d352daf626
commit 274d9ec37e

@ -20,10 +20,19 @@ package org.wso2.carbon.policy.mgt.common;
public class Feature {
private int id;
private String code;
private String name;
private Object attribute;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getCode() {
return code;
}

@ -63,4 +63,19 @@ public class PolicyManagement implements PolicyManagerService {
public Policy getPolicyOfRole(String roleName) throws FeatureManagementException, PolicyManagementException {
return null;
}
@Override
public boolean isPolicyAvailableForDevice(String deviceId, String deviceType) throws PolicyManagementException {
return false;
}
@Override
public boolean isPolicyUsed(String deviceId, String deviceType) throws PolicyManagementException {
return false;
}
@Override
public void setPolicyUsed(String deviceId, String deviceType, Policy policy) throws PolicyManagementException {
}
}

@ -0,0 +1,38 @@
/*
* Copyright (c) 2014 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.policy.mgt.common.spi;
import org.wso2.carbon.policy.mgt.common.Feature;
import org.wso2.carbon.policy.mgt.common.FeatureManagementException;
import java.util.List;
public interface FeatureManagerService {
void addFeature(Feature feature) throws FeatureManagementException;
void editFeature(Feature feature) throws FeatureManagementException;
void removeFeature(int featureId) throws FeatureManagementException;
List<Feature> getFeatures() throws FeatureManagementException;
List<Feature> getFeaturesOfPolicy(int policyId) throws FeatureManagementException;
}

@ -30,6 +30,7 @@ public interface PolicyManagerService {
/**
* This method adds a policy to the platform
*
* @param policy
* @return primary key (generated key)
*/
@ -38,6 +39,7 @@ public interface PolicyManagerService {
/**
* This method adds a policy per device which should be implemented by the related plugins.
*
* @param deviceId
* @param deviceType
* @param policy
@ -48,15 +50,17 @@ public interface PolicyManagerService {
/**
* This method adds a policy to device type by the related device type plugins.
*
* @param deviceType
* @param policy
* @return primary key (generated key)
*/
int addPolicyToDeviceType(String deviceType,Policy policy) throws FeatureManagementException, PolicyManagementException;
int addPolicyToDeviceType(String deviceType, Policy policy) throws FeatureManagementException, PolicyManagementException;
/**
* This method adds the policy to specific role.
*
* @param roleName
* @param policy
* @return primary key (generated key)
@ -65,30 +69,34 @@ public interface PolicyManagerService {
/**
* This method returns the policy of whole platform
*
* @return
*/
Policy getPolicy();
Policy getPolicy();
/**
* This method gives the device specific policy.
*
* @param deviceId
* @param deviceType
* @return Policy
* @return Policy
*/
Policy getPolicyOfDevice(String deviceId, String deviceType) throws FeatureManagementException, PolicyManagementException;
/**
* This method returns the device type specific policy.
*
* @param deviceType
* @return Policy
* @return Policy
*/
Policy getPolicyOfDeviceType(String deviceType) throws FeatureManagementException, PolicyManagementException;
/**
* This method returns the role specific policy.
*
* @param roleName
* @return
*/
@ -96,4 +104,11 @@ public interface PolicyManagerService {
Policy getPolicyOfRole(String roleName) throws FeatureManagementException, PolicyManagementException;
boolean isPolicyAvailableForDevice(String deviceId, String deviceType) throws PolicyManagementException;
boolean isPolicyUsed(String deviceId, String deviceType) throws PolicyManagementException;
void setPolicyUsed(String deviceId, String deviceType, Policy policy) throws PolicyManagementException;
}

@ -105,6 +105,8 @@
<mkdir dir="${tempdir}"/>
<mkdir dir="${tempdir}/wso2cdm-${project.version}/repository/components"/>
<mkdir dir="${tempdir}/wso2cdm-${project.version}/repository/deployment/server"/>
<mkdir dir="${tempdir}/wso2cdm-${project.version}/repository/deployment/server/webapps"/>
<unzip dest="${tempdir}">
<fileset dir="target">
<include name="wso2cdm-${project.version}.zip"/>
@ -137,7 +139,7 @@
og4j.logger.net.sf.ehcache=ERROR
</concat>
<!--<delete file="target/wso2cdm-${project.version}.zip"/>-->
<delete file="target/wso2cdm-${project.version}.zip"/>
<delete dir="${tempdir}"/>
</tasks>
</configuration>
@ -147,6 +149,8 @@
<phase>package</phase>
<configuration>
<tasks>
<mkdir dir="target/wso2carbon-core-${project.version}/repository/deployment/server/webapps"/>
<!--<copy todir="target/wso2carbon-core-${carbon.kernel.version}/modules"
overwrite="true">
<fileset dir="src/repository/modules"></fileset>

@ -40,15 +40,6 @@
</includes>
<fileMode>755</fileMode>
</fileSet>
<!-- <fileSet>
<directory>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/dbscripts/identity/
</directory>
<outputDirectory>wso2cdm-${project.version}/dbscripts/identity</outputDirectory>
<includes>
<include>**/**.sql</include>
</includes>
</fileSet>-->
<!--Multitenancy related file -->
<fileSet>
@ -98,11 +89,11 @@
<fileMode>755</fileMode>
</fileSet>
<!-- copy the landing page webapp -->
<fileSet>
<directory>src/repository/resources/stratos_root</directory>
<outputDirectory>wso2cdm-${project.version}/repository/deployment/server/webapps/STRATOS_ROOT</outputDirectory>
<fileMode>755</fileMode>
</fileSet>
<!-- <fileSet>
<directory>src/repository/resources/stratos_root</directory>
<outputDirectory>wso2cdm-${project.version}/repository/deployment/server/webapps/STRATOS_ROOT</outputDirectory>
<fileMode>755</fileMode>
</fileSet>-->
<fileSet>
<directory>../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/modules</directory>
<outputDirectory>${pom.artifactId}-${project.version}/modules/</outputDirectory>
@ -110,50 +101,14 @@
<include>*/**</include>
</includes>
</fileSet>
<!-- <fileSet>
<directory>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/deployment/server/jaggeryapps
</directory>
<outputDirectory>${pom.artifactId}-${project.version}/repository/deployment/server/jaggeryapps/
</outputDirectory>
<includes>
<include>*/**</include>
</includes>
<excludes>
<exclude>**/social/</exclude>
<exclude>**/fakepublisher/</exclude>
<exclude>**/fakestore/</exclude>
</excludes>
</fileSet>-->
<!--copy jaxrs web app for OAuth feature-->
<!-- <fileSet>
<directory>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/deployment/server/webapps
</directory>
<outputDirectory>${pom.artifactId}-${project.version}/repository/deployment/server/webapps</outputDirectory>
<includes>
<include>oauth2.war</include>
</includes>
</fileSet>
&lt;!&ndash;copy web app for application authentication feature &ndash;&gt;
<fileSet>
<directory>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/deployment/server/webapps
</directory>
<outputDirectory>${pom.artifactId}-${project.version}/repository/deployment/server/webapps</outputDirectory>
<includes>
<include>authenticationendpoint.war</include>
</includes>
</fileSet>-->
<fileSet>
<directory>src/repository/conf</directory>
<outputDirectory>wso2cdm-${project.version}/repository/conf</outputDirectory>
<includes>
<include>**/api-manager.xml</include>
<include>**/sso-idp-config.xml</include>
<!-- <include>**/emm-config.xml</include>-->
<!-- <include>**/emm-config.xml</include>-->
</includes>
</fileSet>
<fileSet>
@ -239,35 +194,42 @@
</dependencySets>
<files>
<!-- <file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/tomcat/webapp-classloading.xml
</source>
<outputDirectory>wso2cdm-${project.version}/repository/conf/tomcat</outputDirectory>
<filtered>true</filtered>
<fileMode>644</fileMode>
</file>
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/tomcat/webapp-classloading-environments.xml
</source>
<outputDirectory>wso2cdm-${project.version}/repository/conf/tomcat</outputDirectory>
<source>../agents/android/jax-rs/target/cdm-android-api.war</source>
<outputDirectory>wso2cdm-${pom.version}/repository/deployment/server/webapps</outputDirectory>
<filtered>true</filtered>
<fileMode>644</fileMode>
</file>-->
<fileMode>755</fileMode>
</file>
<!-- <file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/tomcat/webapp-classloading.xml
</source>
<outputDirectory>wso2cdm-${project.version}/repository/conf/tomcat</outputDirectory>
<filtered>true</filtered>
<fileMode>644</fileMode>
</file>
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/tomcat/webapp-classloading-environments.xml
</source>
<outputDirectory>wso2cdm-${project.version}/repository/conf/tomcat</outputDirectory>
<filtered>true</filtered>
<fileMode>644</fileMode>
</file>-->
<file>
<source>src/repository/conf/tomcat/context.xml</source>
<outputDirectory>wso2cdm-${project.version}/repository/conf/tomcat</outputDirectory>
<filtered>true</filtered>
<fileMode>644</fileMode>
</file>
<!-- <file>
<source>../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/event-broker.xml
</source>
<outputDirectory>wso2cdm-${project.version}/repository/conf/</outputDirectory>
<filtered>true</filtered>
<fileMode>644</fileMode>
</file>-->
<!-- <file>
<source>../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/event-broker.xml
</source>
<outputDirectory>wso2cdm-${project.version}/repository/conf/</outputDirectory>
<filtered>true</filtered>
<fileMode>644</fileMode>
</file>-->
<file>
<source>INSTALL.txt</source>
@ -307,18 +269,14 @@
</file>
<!--copy default xacml policy to repository/resources/security -->
<!-- <file>
<source>src/repository/resources/policies/xacml/default/admin.xml</source>
<outputDirectory>wso2cdm-${project.version}/repository/resources/security/policies/xacml/default
</outputDirectory>
<filtered>true</filtered>
</file>-->
<!-- <file>
<source>src/repository/resources/policies/xacml/default/admin.xml</source>
<outputDirectory>wso2cdm-${project.version}/repository/resources/security/policies/xacml/default
</outputDirectory>
<filtered>true</filtered>
</file>-->
<file>
<source>target/wso2carbon-core-${carbon.kernel.version}/repository/conf/log4j.properties</source>
<outputDirectory>wso2cdm-${project.version}/repository/conf/</outputDirectory>
<filtered>true</filtered>
</file>
<file>
<source>src/repository/conf/multitenancy/cloud-services-desc.xml</source>
<outputDirectory>wso2cdm-${project.version}/repository/conf/multitenancy/</outputDirectory>
@ -354,15 +312,18 @@
</file>
<file>
<source>../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/tomcat/webapp-classloading.xml</source>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/tomcat/webapp-classloading.xml
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/conf/tomcat</outputDirectory>
<filtered>true</filtered>
<fileMode>644</fileMode>
</file>
<!--cdm config file-->
<!--cdm config file-->
<file>
<source>../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/cdm-config.xml</source>
<source>../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/cdm-config.xml
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/conf</outputDirectory>
<filtered>true</filtered>
<fileMode>644</fileMode>
@ -370,19 +331,21 @@
<file>
<source>../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/tomcat/webapp-classloading-environments.xml</source>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/tomcat/webapp-classloading-environments.xml
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/conf/tomcat</outputDirectory>
<filtered>true</filtered>
<fileMode>644</fileMode>
</file>
<!-- nTask Component -->
<!-- <file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/etc/tasks-config.xml
</source>
<outputDirectory>wso2cdm-${project.version}/repository/conf/etc</outputDirectory>
</file>-->
<!-- <file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/etc/tasks-config.xml
</source>
<outputDirectory>wso2cdm-${project.version}/repository/conf/etc</outputDirectory>
</file>-->
<!-- End - nTask Component -->
</files>

Loading…
Cancel
Save