-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #471 from sadilchamishka/onboard-b2b-org-mgt-APIs
Onboard b2b organization and role management APIs
- Loading branch information
Showing
69 changed files
with
11,097 additions
and
2 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
...ion.management/org.wso2.carbon.identity.api.server.organization.management.common/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). | ||
~ | ||
~ WSO2 LLC. 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. | ||
--> | ||
|
||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
|
||
<parent> | ||
<groupId>org.wso2.carbon.identity.server.api</groupId> | ||
<artifactId>org.wso2.carbon.identity.api.server.organization.management</artifactId> | ||
<version>1.2.67-SNAPSHOT</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
<artifactId>org.wso2.carbon.identity.api.server.organization.management.common</artifactId> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-web</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.wso2.carbon.identity.organization.management.core</groupId> | ||
<artifactId>org.wso2.carbon.identity.organization.management.service</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.wso2.carbon.identity.organization.management</groupId> | ||
<artifactId>org.wso2.carbon.identity.organization.management.application</artifactId> | ||
</dependency> | ||
</dependencies> | ||
</project> |
82 changes: 82 additions & 0 deletions
82
...entity/api/server/organization/management/common/OrganizationManagementServiceHolder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
/* | ||
* Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). | ||
* | ||
* WSO2 LLC. 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.identity.api.server.organization.management.common; | ||
|
||
import org.wso2.carbon.identity.organization.management.application.OrgApplicationManager; | ||
import org.wso2.carbon.identity.organization.management.service.OrganizationManager; | ||
|
||
/** | ||
* Service holder class for organization management related services. | ||
*/ | ||
public class OrganizationManagementServiceHolder { | ||
|
||
private static OrganizationManagementServiceHolder instance = new OrganizationManagementServiceHolder(); | ||
|
||
private OrgApplicationManager orgApplicationManager; | ||
private OrganizationManager organizationManager; | ||
|
||
private OrganizationManagementServiceHolder() { | ||
|
||
} | ||
|
||
public static OrganizationManagementServiceHolder getInstance() { | ||
|
||
return instance; | ||
} | ||
|
||
/** | ||
* Get OrgApplicationManager OSGi service. | ||
* | ||
* @return OrgApplicationManager. | ||
*/ | ||
public OrgApplicationManager getOrgApplicationManager() { | ||
|
||
return OrganizationManagementServiceHolder.getInstance().orgApplicationManager; | ||
} | ||
|
||
/** | ||
* Set OrgApplicationManager OSGi service. | ||
* | ||
* @param orgApplicationManager OrgApplicationManager. | ||
*/ | ||
public void setOrgApplicationManager(OrgApplicationManager orgApplicationManager) { | ||
|
||
OrganizationManagementServiceHolder.getInstance().orgApplicationManager = orgApplicationManager; | ||
} | ||
|
||
/** | ||
* Get OrganizationManager OSGi service. | ||
* | ||
* @return OrganizationManager. | ||
*/ | ||
public OrganizationManager getOrganizationManager() { | ||
|
||
return OrganizationManagementServiceHolder.getInstance().organizationManager; | ||
} | ||
|
||
/** | ||
* Set OrganizationManager OSGi service. | ||
* | ||
* @param organizationManager OrganizationManager. | ||
*/ | ||
public void setOrganizationManager(OrganizationManager organizationManager) { | ||
|
||
OrganizationManagementServiceHolder.getInstance().organizationManager = organizationManager; | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
...erver/organization/management/common/factory/OrgApplicationManagerOSGIServiceFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). | ||
* | ||
* WSO2 LLC. 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.identity.api.server.organization.management.common.factory; | ||
|
||
import org.springframework.beans.factory.config.AbstractFactoryBean; | ||
import org.wso2.carbon.context.PrivilegedCarbonContext; | ||
import org.wso2.carbon.identity.organization.management.application.OrgApplicationManager; | ||
|
||
/** | ||
* Factory Beans serves as a factory for creating other beans within the IOC container. This factory bean is used to | ||
* instantiate the OrgApplicationManager type of object inside the container. | ||
*/ | ||
public class OrgApplicationManagerOSGIServiceFactory extends AbstractFactoryBean<OrgApplicationManager> { | ||
|
||
private OrgApplicationManager orgApplicationManager; | ||
|
||
@Override | ||
public Class<?> getObjectType() { | ||
|
||
return Object.class; | ||
} | ||
|
||
@Override | ||
protected OrgApplicationManager createInstance() throws Exception { | ||
|
||
if (this.orgApplicationManager == null) { | ||
OrgApplicationManager service = (OrgApplicationManager) PrivilegedCarbonContext. | ||
getThreadLocalCarbonContext().getOSGiService(OrgApplicationManager.class, null); | ||
if (service != null) { | ||
this.orgApplicationManager = service; | ||
} else { | ||
throw new Exception("Unable to retrieve OrgApplicationManager service."); | ||
} | ||
} | ||
return this.orgApplicationManager; | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
...rver/organization/management/common/factory/OrganizationManagementOSGIServiceFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). | ||
* | ||
* WSO2 LLC. 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.identity.api.server.organization.management.common.factory; | ||
|
||
import org.springframework.beans.factory.config.AbstractFactoryBean; | ||
import org.wso2.carbon.context.PrivilegedCarbonContext; | ||
import org.wso2.carbon.identity.organization.management.service.OrganizationManager; | ||
|
||
/** | ||
* Factory Beans serves as a factory for creating other beans within the IOC container. This factory bean is used to | ||
* instantiate the OrganizationManager type of object inside the container. | ||
*/ | ||
public class OrganizationManagementOSGIServiceFactory extends AbstractFactoryBean<OrganizationManager> { | ||
|
||
private OrganizationManager organizationManager; | ||
|
||
@Override | ||
public Class<?> getObjectType() { | ||
|
||
return Object.class; | ||
} | ||
|
||
@Override | ||
protected OrganizationManager createInstance() throws Exception { | ||
|
||
if (this.organizationManager == null) { | ||
OrganizationManager service = (OrganizationManager) PrivilegedCarbonContext. | ||
getThreadLocalCarbonContext().getOSGiService(OrganizationManager.class, null); | ||
if (service != null) { | ||
this.organizationManager = service; | ||
} else { | ||
throw new Exception("Unable to retrieve OrganizationManager service."); | ||
} | ||
} | ||
return this.organizationManager; | ||
} | ||
} |
Oops, something went wrong.