forked from community/device-mgt-core
parent
69ba3e83ea
commit
1c8bb7551d
@ -1,48 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
||||
* Version 2.0 (the "License"); you may not use this file except
|
||||
* in compliance with the License.
|
||||
* you may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.wso2.carbon.dynamic.client.registration.internal;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.osgi.framework.BundleActivator;
|
||||
import org.osgi.framework.BundleContext;
|
||||
import org.wso2.carbon.dynamic.client.registration.DynamicClientRegistrationService;
|
||||
import org.wso2.carbon.dynamic.client.registration.impl.DynamicClientRegistrationImpl;
|
||||
|
||||
/**
|
||||
* BundleActivator class of DynamicClientRegistration component.
|
||||
*/
|
||||
public class DynamicClientRegistrationBundleActivator implements BundleActivator{
|
||||
|
||||
private static final Log log = LogFactory.getLog(DynamicClientRegistrationBundleActivator.class);
|
||||
|
||||
@Override
|
||||
public void start(BundleContext bundleContext) throws Exception {
|
||||
DynamicClientRegistrationService dynamicClientRegistrationService =
|
||||
new DynamicClientRegistrationImpl();
|
||||
bundleContext.registerService(DynamicClientRegistrationService.class.getName(),
|
||||
dynamicClientRegistrationService, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop(BundleContext bundleContext) throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
||||
* Version 2.0 (the "License"); you may not use this file except
|
||||
* in compliance with the License.
|
||||
* you may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.wso2.carbon.dynamic.client.registration.internal;
|
||||
|
||||
import org.wso2.carbon.identity.application.mgt.ApplicationManagementService;
|
||||
|
||||
/**
|
||||
* DataHolder class of DynamicClientRegistration bundle. This hold a reference to
|
||||
* ApplicationManagementService.
|
||||
*/
|
||||
public class DynamicClientRegistrationDataHolder {
|
||||
|
||||
private ApplicationManagementService applicationManagementService;
|
||||
|
||||
private static DynamicClientRegistrationDataHolder thisInstance =
|
||||
new DynamicClientRegistrationDataHolder();
|
||||
|
||||
private DynamicClientRegistrationDataHolder() {
|
||||
}
|
||||
|
||||
public static DynamicClientRegistrationDataHolder getInstance() {
|
||||
return thisInstance;
|
||||
}
|
||||
|
||||
public ApplicationManagementService getApplicationManagementService() {
|
||||
if (applicationManagementService == null) {
|
||||
throw new IllegalStateException("ApplicationManagementService is not initialized properly");
|
||||
}
|
||||
return applicationManagementService;
|
||||
}
|
||||
|
||||
public void setApplicationManagementService(ApplicationManagementService realmService) {
|
||||
this.applicationManagementService = realmService;
|
||||
}
|
||||
}
|
@ -0,0 +1,85 @@
|
||||
/*
|
||||
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
||||
* Version 2.0 (the "License"); you may not use this file except
|
||||
* in compliance with the License.
|
||||
* you may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.wso2.carbon.dynamic.client.registration.internal;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.osgi.service.component.ComponentContext;
|
||||
import org.wso2.carbon.dynamic.client.registration.DynamicClientRegistrationService;
|
||||
import org.wso2.carbon.dynamic.client.registration.impl.DynamicClientRegistrationImpl;
|
||||
import org.wso2.carbon.identity.application.mgt.ApplicationManagementService;
|
||||
|
||||
/**
|
||||
* @scr.component name="org.wso2.carbon.dynamic.client.registration" immediate="true"
|
||||
* @scr.reference name="identity.application.management.service"
|
||||
* interface="org.wso2.carbon.identity.application.mgt.ApplicationManagementService"
|
||||
* cardinality="1..1"
|
||||
* policy="dynamic"
|
||||
* bind="setApplicationManagementService"
|
||||
* unbind="unsetApplicationManagementService"
|
||||
*/
|
||||
public class DynamicClientRegistrationServiceComponent {
|
||||
|
||||
private static final Log log = LogFactory.getLog(DynamicClientRegistrationServiceComponent.class);
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
protected void activate(ComponentContext componentContext) {
|
||||
if(log.isDebugEnabled()){
|
||||
log.debug("Starting DynamicClientRegistrationServiceComponent");
|
||||
}
|
||||
DynamicClientRegistrationService dynamicClientRegistrationService =
|
||||
new DynamicClientRegistrationImpl();
|
||||
componentContext.getBundleContext().registerService(DynamicClientRegistrationService.class.getName(),
|
||||
dynamicClientRegistrationService, null);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
protected void deactivate(ComponentContext componentContext) {
|
||||
if(log.isDebugEnabled()){
|
||||
log.debug("Stopping DynamicClientRegistrationServiceComponent");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets ApplicationManagement Service.
|
||||
*
|
||||
* @param applicationManagementService An instance of ApplicationManagementService
|
||||
*/
|
||||
protected void setApplicationManagementService(ApplicationManagementService
|
||||
applicationManagementService) {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Setting ApplicationManagement Service");
|
||||
}
|
||||
DynamicClientRegistrationDataHolder.getInstance().
|
||||
setApplicationManagementService(applicationManagementService);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets ApplicationManagement Service.
|
||||
*
|
||||
* @param applicationManagementService An instance of ApplicationManagementService
|
||||
*/
|
||||
protected void unsetApplicationManagementService(ApplicationManagementService
|
||||
applicationManagementService) {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Unsetting ApplicationManagement Service");
|
||||
}
|
||||
DynamicClientRegistrationDataHolder.getInstance().setApplicationManagementService(null);
|
||||
}
|
||||
}
|
8
components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/validators/ScopeValidator.java → components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/validators/PermissionBasedScopeValidator.java
8
components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/validators/ScopeValidator.java → components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/validators/PermissionBasedScopeValidator.java
Loading…
Reference in new issue