-
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.
- Loading branch information
Showing
136 changed files
with
5,914 additions
and
99 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
72 changes: 72 additions & 0 deletions
72
...y.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.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,72 @@ | ||
<?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"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.wso2.carbon.identity.server.api</groupId> | ||
<artifactId>org.wso2.carbon.identity.api.server.api.resource</artifactId> | ||
<version>1.2.85-SNAPSHOT</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
|
||
<artifactId>org.wso2.carbon.identity.api.server.api.resource.common</artifactId> | ||
<packaging>jar</packaging> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<configuration> | ||
<source>1.8</source> | ||
<target>1.8</target> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-web</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>javax.ws.rs</groupId> | ||
<artifactId>javax.ws.rs-api</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.wso2.carbon.identity.framework</groupId> | ||
<artifactId>org.wso2.carbon.identity.application.mgt</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.wso2.carbon.identity.framework</groupId> | ||
<artifactId>org.wso2.carbon.identity.api.resource.mgt</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.wso2.carbon.identity.inbound.auth.oauth2</groupId> | ||
<artifactId>org.wso2.carbon.identity.oauth</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
71 changes: 71 additions & 0 deletions
71
...o2/carbon/identity/api/server/api/resource/common/APIResourceManagementServiceHolder.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,71 @@ | ||
/* | ||
* 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.api.resource.common; | ||
|
||
import org.wso2.carbon.identity.api.resource.mgt.APIResourceManager; | ||
import org.wso2.carbon.identity.oauth.OAuthAdminServiceImpl; | ||
|
||
/** | ||
* Service holder class for api resource management. | ||
*/ | ||
public class APIResourceManagementServiceHolder { | ||
|
||
private static APIResourceManager apiResourceManager; | ||
private static OAuthAdminServiceImpl oAuthAdminServiceImpl; | ||
|
||
/** | ||
* Get APIResourceManager osgi service. | ||
* | ||
* @return APIResourceManager. | ||
*/ | ||
public static APIResourceManager getApiResourceManager() { | ||
|
||
return apiResourceManager; | ||
} | ||
|
||
/** | ||
* Set APIResourceManager osgi service. | ||
* | ||
* @param apiResourceManager APIResourceManager. | ||
*/ | ||
public static void setApiResourceManager(APIResourceManager apiResourceManager) { | ||
|
||
APIResourceManagementServiceHolder.apiResourceManager = apiResourceManager; | ||
} | ||
|
||
/** | ||
* Get OAuthAdminServiceImpl instance. | ||
* | ||
* @return OAuthAdminServiceImpl instance. | ||
*/ | ||
public static OAuthAdminServiceImpl getOAuthAdminServiceImpl() { | ||
|
||
return oAuthAdminServiceImpl; | ||
} | ||
|
||
/** | ||
* Set OAuthAdminServiceImpl instance. | ||
* | ||
* @param oAuthAdminServiceImpl OAuthAdminServiceImpl instance. | ||
*/ | ||
public static void setOAuthAdminServiceImpl(OAuthAdminServiceImpl oAuthAdminServiceImpl) { | ||
|
||
APIResourceManagementServiceHolder.oAuthAdminServiceImpl = oAuthAdminServiceImpl; | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
...bon/identity/api/server/api/resource/common/factory/APIResourceMgtOSGiServiceFactory.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,50 @@ | ||
/* | ||
* 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.api.resource.common.factory; | ||
|
||
import org.springframework.beans.factory.config.AbstractFactoryBean; | ||
import org.wso2.carbon.context.PrivilegedCarbonContext; | ||
import org.wso2.carbon.identity.api.resource.mgt.APIResourceManager; | ||
|
||
/** | ||
* Factory class for APIResourceManagementOSGiService. | ||
*/ | ||
public class APIResourceMgtOSGiServiceFactory extends AbstractFactoryBean<APIResourceManager> { | ||
|
||
private APIResourceManager apiResourceManager; | ||
|
||
@Override | ||
public Class<?> getObjectType() { | ||
|
||
return Object.class; | ||
} | ||
|
||
@Override | ||
protected APIResourceManager createInstance() throws Exception { | ||
|
||
if (this.apiResourceManager == null) { | ||
apiResourceManager = (APIResourceManager) PrivilegedCarbonContext. | ||
getThreadLocalCarbonContext().getOSGiService(APIResourceManager.class, null); | ||
if (apiResourceManager == null) { | ||
throw new Exception("Unable to retrieve APIResourceManager service."); | ||
} | ||
} | ||
return this.apiResourceManager; | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
.../carbon/identity/api/server/api/resource/common/factory/OAuthAdminOSGiServiceFactory.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.api.resource.common.factory; | ||
|
||
import org.springframework.beans.factory.config.AbstractFactoryBean; | ||
import org.wso2.carbon.context.PrivilegedCarbonContext; | ||
import org.wso2.carbon.identity.oauth.OAuthAdminServiceImpl; | ||
|
||
/** | ||
* Factory Beans serves as a factory for creating other beans within the IOC container. This factory bean is used to | ||
* instantiate the OAuthAdminServiceImpl type of object inside the container. | ||
*/ | ||
public class OAuthAdminOSGiServiceFactory extends AbstractFactoryBean<OAuthAdminServiceImpl> { | ||
|
||
private OAuthAdminServiceImpl oauthAdminService; | ||
|
||
@Override | ||
public Class<?> getObjectType() { | ||
|
||
return Object.class; | ||
} | ||
|
||
@Override | ||
protected OAuthAdminServiceImpl createInstance() throws Exception { | ||
|
||
if (this.oauthAdminService == null) { | ||
oauthAdminService = (OAuthAdminServiceImpl) PrivilegedCarbonContext | ||
.getThreadLocalCarbonContext().getOSGiService(OAuthAdminServiceImpl.class, null); | ||
|
||
if (oauthAdminService == null) { | ||
throw new Exception("Unable to retrieve OAuthAdminServiceImpl service."); | ||
} | ||
} | ||
return this.oauthAdminService; | ||
} | ||
} | ||
|
Oops, something went wrong.