当前位置: 首页>>代码示例>>Java>>正文


Java OsiamConnector类代码示例

本文整理汇总了Java中org.osiam.client.OsiamConnector的典型用法代码示例。如果您正苦于以下问题:Java OsiamConnector类的具体用法?Java OsiamConnector怎么用?Java OsiamConnector使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


OsiamConnector类属于org.osiam.client包,在下文中一共展示了OsiamConnector类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: AccessTokenValidationService

import org.osiam.client.OsiamConnector; //导入依赖的package包/类
@Autowired
public AccessTokenValidationService(
        @Value("${org.osiam.auth-server.home}") String authServerHome,
        @Value("${org.osiam.auth-server.connector.max-connections:40}") int maxConnections,
        @Value("${org.osiam.auth-server.connector.read-timeout-ms:10000}") int readTimeout,
        @Value("${org.osiam.auth-server.connector.connect-timeout-ms:5000}") int connectTimeout
) {
    this.authServerHome = authServerHome;
    this.connector = new OsiamConnector.Builder()
            .setAuthServerEndpoint(authServerHome)
            .withReadTimeout(readTimeout)
            .withConnectTimeout(connectTimeout)
            .build();
    OsiamConnector.setMaxConnections(maxConnections);
    OsiamConnector.setMaxConnectionsPerRoute(maxConnections);
}
 
开发者ID:osiam,项目名称:resource-server,代码行数:17,代码来源:AccessTokenValidationService.java

示例2: build

import org.osiam.client.OsiamConnector; //导入依赖的package包/类
@Bean
public OsiamConnector build() {
    OsiamConnector.Builder builder = new OsiamConnector.Builder()
            .setClientRedirectUri(redirectUri)
            .setClientId(clientId)
            .setClientSecret(clientSecret);

    if (!Strings.isNullOrEmpty(osiamEndpoint)) {
        builder.withEndpoint(osiamEndpoint);
    } else if (!Strings.isNullOrEmpty(authServerEndpoint) && !Strings.isNullOrEmpty(resourceServerEndpoint)) {
        builder.setAuthServerEndpoint(authServerEndpoint)
                .setResourceServerEndpoint(resourceServerEndpoint)
                .withLegacySchemas(useLegacySchemas);
    } else {
        throw new BeanCreationException("Error creating OSIAM connector. No OSIAM endpoint set.");
    }

    return builder.build();
}
 
开发者ID:osiam,项目名称:addon-administration,代码行数:20,代码来源:ConnectorBuilder.java

示例3: connect

import org.osiam.client.OsiamConnector; //导入依赖的package包/类
@Command(description=COMMAND_DESCRIPTION_WITH_SECRET, startsSubshell = true)
public void connect(
		@Param(value = PARAM_NAME_OSIAM_ENDPOINT, description = PARAM_DESCRIPTION_OSIAM_ENDPOINT)
		String osiamEndpoint,
		@Param(value = PARAM_NAME_REDIRECT_URI, description = PARAM_DESCRIPTION_REDIRECT_URI)
		String redirectUri,
		@Param(value = PARAM_NAME_CLIENT_ID, description = PARAM_DESCRIPTION_CLIENT_ID)
		String clientId,
		@Param(value = PARAM_NAME_CLIENT_SECRET, description = PARAM_DESCRIPTION_CLIENT_SECRET)
		String clientSecret) throws IOException{

	if(inRecordMode()){
		openSubShell(null);
		return;
	}

	final OsiamConnector connector = new OsiamConnector.Builder()
										.setEndpoint(osiamEndpoint)
										.setClientId(clientId)
										.setClientSecret(clientSecret)
										.setClientRedirectUri(redirectUri)
									.build();

	openSubShell(connector);
}
 
开发者ID:osiam,项目名称:shell,代码行数:26,代码来源:ConnectionCommand.java

示例4: createOsiamConnector

import org.osiam.client.OsiamConnector; //导入依赖的package包/类
private OsiamConnector createOsiamConnector() {
    return new OsiamConnector.Builder()
            .setAuthServerEndpoint(authServerHome)
            .setResourceServerEndpoint(resourceServerHome)
            .setClientId(OsiamAuthServerClientProvider.AUTH_SERVER_CLIENT_ID)
            .setClientSecret(authServerClientProvider.getClientSecret())
            .withReadTimeout(readTimeout)
            .withConnectTimeout(connectTimeout)
            .build();
}
 
开发者ID:osiam,项目名称:auth-server,代码行数:11,代码来源:ResourceServerConnector.java

示例5: openSubShell

import org.osiam.client.OsiamConnector; //导入依赖的package包/类
private void openSubShell(OsiamConnector connector) throws IOException {
	final Shell subshell = ShellBuilder.subshell(getHostName(connector), shell)
							.behavior()
								.addHandler(new LoginCommand(connector))
							.build();

	subshell.commandLoop();
}
 
开发者ID:osiam,项目名称:shell,代码行数:9,代码来源:ConnectionCommand.java

示例6: setupDB

import org.osiam.client.OsiamConnector; //导入依赖的package包/类
@BeforeClass
public static void setupDB() {
    System.out.println("Setting up DB");
    try (ConfigurableApplicationContext applicationContext = new ClassPathXmlApplicationContext("context.xml")) {
        IDatabaseConnection connection = new DatabaseDataSourceConnection(
                (DataSource) applicationContext.getBean("dataSource"));

        try {
            DatabaseOperation.CLEAN_INSERT.execute(connection,
                    new FlatXmlDataSetBuilder().build(
                            applicationContext.getResource("/database_seed.xml").getInputStream()));
        } finally {
            connection.close();
        }
    } catch (Exception e) {
        e.printStackTrace();
    }

    System.out.println("Setting up Connector");
    OsiamConnector.Builder oConBuilder = new OsiamConnector.Builder().
            setAuthServerEndpoint(AUTH_ENDPOINT_ADDRESS).
            setResourceServerEndpoint(RESOURCE_ENDPOINT_ADDRESS).
            setClientId(CLIENT_ID).
            setClientSecret(CLIENT_SECRET);
    osiamConnector = oConBuilder.build();

    System.out.println("Retrieving access token");
    accessToken = osiamConnector.retrieveAccessToken("marissa", "koala", Scope.ADMIN);
}
 
开发者ID:osiam,项目名称:test-suites,代码行数:30,代码来源:PerformanceTestContext.java

示例7: setupConnector

import org.osiam.client.OsiamConnector; //导入依赖的package包/类
public static void setupConnector() throws Exception {
    OsiamConnector.Builder oConBuilder = new OsiamConnector.Builder().
            setAuthServerEndpoint(AUTH_ENDPOINT_ADDRESS).
            setResourceServerEndpoint(RESOURCE_ENDPOINT_ADDRESS).
            setClientId(CLIENT_ID).
            setClientSecret(CLIENT_SECRET);
    oConnector = oConBuilder.build();
    accessToken = oConnector.retrieveAccessToken("marissa", "koala", Scope.ADMIN);
}
 
开发者ID:osiam,项目名称:test-suites,代码行数:10,代码来源:TestDataCreation.java

示例8: getConnector

import org.osiam.client.OsiamConnector; //导入依赖的package包/类
public OsiamConnector getConnector(String key) {
    OsiamConnector osiamConnector = connectors.get(key);
    if (osiamConnector == null) {
        OsiamConnector.Builder oConBuilder = new OsiamConnector.Builder().
                setAuthServerEndpoint(AUTH_ENDPOINT_ADDRESS).
                setResourceServerEndpoint(RESOURCE_ENDPOINT_ADDRESS).
                setClientId(CLIENT_ID).
                setClientSecret(CLIENT_SECRET);
        osiamConnector = oConBuilder.build();
        connectors.put(key, osiamConnector);
    }
    return osiamConnector;
}
 
开发者ID:osiam,项目名称:test-suites,代码行数:14,代码来源:OsiamContext.java

示例9: afterPropertiesSet

import org.osiam.client.OsiamConnector; //导入依赖的package包/类
@Override
public void afterPropertiesSet() throws Exception {
    OsiamConnector.setMaxConnections(maxConnections);
    OsiamConnector.setMaxConnectionsPerRoute(maxConnections);
}
 
开发者ID:osiam,项目名称:auth-server,代码行数:6,代码来源:ResourceServerConnector.java

示例10: LoginCommand

import org.osiam.client.OsiamConnector; //导入依赖的package包/类
public LoginCommand(OsiamConnector connector) {
	this.connector = connector;
}
 
开发者ID:osiam,项目名称:shell,代码行数:4,代码来源:LoginCommand.java

示例11: SearchResultCommand

import org.osiam.client.OsiamConnector; //导入依赖的package包/类
public SearchResultCommand(AccessToken at, OsiamConnector connector, Query query) {
	super(at, connector);
	
	this.index = query.getStartIndex();
	this.query = query;
}
 
开发者ID:osiam,项目名称:shell,代码行数:7,代码来源:SearchResultCommand.java

示例12: SelectUserCommand

import org.osiam.client.OsiamConnector; //导入依赖的package包/类
public SelectUserCommand(AccessToken at, OsiamConnector connector) {
	super(at, connector);
}
 
开发者ID:osiam,项目名称:shell,代码行数:4,代码来源:SelectUserCommand.java

示例13: SelectGroupCommand

import org.osiam.client.OsiamConnector; //导入依赖的package包/类
public SelectGroupCommand(AccessToken at, OsiamConnector connector) {
	super(at, connector);
}
 
开发者ID:osiam,项目名称:shell,代码行数:4,代码来源:SelectGroupCommand.java

示例14: GroupSearchResultCommand

import org.osiam.client.OsiamConnector; //导入依赖的package包/类
public GroupSearchResultCommand(AccessToken at, OsiamConnector connector, Query query) {
	super(at, connector, query);
}
 
开发者ID:osiam,项目名称:shell,代码行数:4,代码来源:GroupSearchResultCommand.java

示例15: UserSearchResultCommand

import org.osiam.client.OsiamConnector; //导入依赖的package包/类
public UserSearchResultCommand(AccessToken at, OsiamConnector connector, Query query) {
	super(at, connector, query);
}
 
开发者ID:osiam,项目名称:shell,代码行数:4,代码来源:UserSearchResultCommand.java


注:本文中的org.osiam.client.OsiamConnector类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。