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


Java Options.setManageSession方法代码示例

本文整理汇总了Java中org.apache.axis2.client.Options.setManageSession方法的典型用法代码示例。如果您正苦于以下问题:Java Options.setManageSession方法的具体用法?Java Options.setManageSession怎么用?Java Options.setManageSession使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.axis2.client.Options的用法示例。


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

示例1: setupValidationService

import org.apache.axis2.client.Options; //导入方法依赖的package包/类
/**
 * 
 * @param stub
 * @return receives a non prepared stub and set up it
 */
private OAuth2TokenValidationServiceStub setupValidationService(OAuth2TokenValidationServiceStub stub) {
    AuthProperties props = AuthProperties.inst();

    ServiceClient client = stub._getServiceClient();
    Options options = client.getOptions();

    CarbonUtils.setBasicAccessSecurityHeaders(props.getWso2User(), props.getWso2Password(), true, client);

    options.setTimeOutInMilliSeconds(TIMEOUT_IN_MILLIS);
    options.setProperty(HTTPConstants.SO_TIMEOUT, TIMEOUT_IN_MILLIS);
    options.setProperty(HTTPConstants.CONNECTION_TIMEOUT, TIMEOUT_IN_MILLIS);
    options.setCallTransportCleanup(true);
    options.setManageSession(true);

    return stub;
}
 
开发者ID:romulets,项目名称:wso2is-example,代码行数:22,代码来源:TokenValidationService.java

示例2: ApplicationManagementServiceClient

import org.apache.axis2.client.Options; //导入方法依赖的package包/类
/**
 * @param cookie
 * @param backendServerURL
 * @param configCtx
 * @throws AxisFault
 */
public ApplicationManagementServiceClient(String cookie, String backendServerURL,
                                          ConfigurationContext configCtx) throws AxisFault {

    String serviceURL = backendServerURL + "IdentityApplicationManagementService";
    String userAdminServiceURL = backendServerURL + "UserAdmin";
    stub = new IdentityApplicationManagementServiceStub(configCtx, serviceURL);
    userAdminStub = new UserAdminStub(configCtx, userAdminServiceURL);

    ServiceClient client = stub._getServiceClient();
    Options option = client.getOptions();
    option.setManageSession(true);
    option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);

    ServiceClient userAdminClient = userAdminStub._getServiceClient();
    Options userAdminOptions = userAdminClient.getOptions();
    userAdminOptions.setManageSession(true);
    userAdminOptions.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);

    if (debugEnabled) {
        log.debug("Invoking service " + serviceURL);
    }

}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:30,代码来源:ApplicationManagementServiceClient.java

示例3: authenticateStub

import org.apache.axis2.client.Options; //导入方法依赖的package包/类
public static Stub authenticateStub(Stub stub, String sessionCookie, String backendURL) {
    long soTimeout = 5 * 60 * 1000; // Three minutes

    ServiceClient client = stub._getServiceClient();
    Options option = client.getOptions();
    option.setManageSession(true);
    option.setTimeOutInMilliSeconds(soTimeout);
    System.out.println("XXXXXXXXXXXXXXXXXXX" +
            backendURL +  client.getServiceContext().getAxisService().getName().replaceAll("[^a-zA-Z]", ""));
    option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, sessionCookie);
    option.setTo(new EndpointReference(backendURL +  client.getServiceContext().getAxisService().getName().replaceAll("[^a-zA-Z]", "")));
    if (log.isDebugEnabled()) {
        log.debug("AuthenticateStub : Stub created with session " + sessionCookie);
    }

    return stub;
}
 
开发者ID:DistX,项目名称:Learning,代码行数:18,代码来源:AuthenticateStub.java

示例4: authenticateStub

import org.apache.axis2.client.Options; //导入方法依赖的package包/类
public static Stub authenticateStub(Stub stub, String sessionCookie, String backendURL) {
    long soTimeout = 5 * 60 * 1000; // Three minutes

    ServiceClient client = stub._getServiceClient();
    Options option = client.getOptions();
    option.setManageSession(true);
    option.setTimeOutInMilliSeconds(soTimeout);
    System.out.println("XXXXXXXXXXXXXXXXXXX" +
                       backendURL +  client.getServiceContext().getAxisService().getName().replaceAll("[^a-zA-Z]", ""));
    option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, sessionCookie);
    option.setTo(new EndpointReference(backendURL +  client.getServiceContext().getAxisService().getName().replaceAll("[^a-zA-Z]", "")));
    if (log.isDebugEnabled()) {
        log.debug("AuthenticateStub : Stub created with session " + sessionCookie);
    }

    return stub;
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:18,代码来源:AuthenticateStub.java

示例5: UserProfileCient

import org.apache.axis2.client.Options; //导入方法依赖的package包/类
public UserProfileCient(String cookie, String url,
                        ConfigurationContext configContext) throws java.lang.Exception {
    try {
        this.serviceEndPoint = url + "UserProfileMgtService";
        stub = new UserProfileMgtServiceStub(configContext, serviceEndPoint);

        ServiceClient client = stub._getServiceClient();
        Options option = client.getOptions();
        option.setManageSession(true);
        option
                .setProperty(
                        org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING,
                        cookie);
    } catch (java.lang.Exception e) {
        log.error(e);
        throw e;
    }
}
 
开发者ID:wso2-attic,项目名称:carbon-identity,代码行数:19,代码来源:UserProfileCient.java

示例6: ResourceServiceClient

import org.apache.axis2.client.Options; //导入方法依赖的package包/类
public ResourceServiceClient(
        String cookie, String backendServerURL, ConfigurationContext configContext)
        throws RegistryException {

    epr = backendServerURL + "ResourceAdminService";

    try {
        stub = new ResourceAdminServiceStub(configContext, epr);

        ServiceClient client = stub._getServiceClient();
        Options option = client.getOptions();
        option.setManageSession(true);
        option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);

    } catch (AxisFault axisFault) {
        String msg = "Failed to initiate resource service client. " + axisFault.getMessage();
        log.error(msg, axisFault);
        throw new RegistryException(msg, axisFault);
    }
}
 
开发者ID:wso2,项目名称:carbon-registry,代码行数:21,代码来源:ResourceServiceClient.java

示例7: LifeCycleManagementServiceClient

import org.apache.axis2.client.Options; //导入方法依赖的package包/类
public LifeCycleManagementServiceClient(String cookie, ServletConfig config, HttpSession session)
        throws RegistryException {

    String backendServerURL = CarbonUIUtil.getServerURL(config.getServletContext(), session);
    ConfigurationContext configContext = (ConfigurationContext) config.
            getServletContext().getAttribute(CarbonConstants.CONFIGURATION_CONTEXT);
    epr = backendServerURL + "LifeCycleManagementService";

    try {
        stub = new LifeCycleManagementServiceStub(configContext, epr);

        ServiceClient client = stub._getServiceClient();
        Options option = client.getOptions();
        option.setManageSession(true);
        option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);

    } catch (AxisFault axisFault) {
        String msg = "Failed to initiate life cycle service client. " + axisFault.getMessage();
        log.error(msg, axisFault);
        throw new RegistryException(msg, axisFault);
    }
}
 
开发者ID:wso2,项目名称:carbon-governance,代码行数:23,代码来源:LifeCycleManagementServiceClient.java

示例8: ProcessManagementServiceClient

import org.apache.axis2.client.Options; //导入方法依赖的package包/类
public ProcessManagementServiceClient(
            String cookie,
            String backendServerURL,
            ConfigurationContext configContext, Locale locale) throws AxisFault {
        this.cookie = cookie;
        this.backendServerURL = backendServerURL;
        this.configContext = configContext;
        this.locale = locale;
//        bundle = ResourceBundle.getBundle(BUNDLE, locale);
        String serviceURL = backendServerURL + "ProcessManagementService";
        stub = new ProcessManagementServiceStub(configContext, serviceURL);
        ServiceClient client = stub._getServiceClient();
        Options option = client.getOptions();
        option.setManageSession(true);
        option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);
    }
 
开发者ID:wso2,项目名称:carbon-business-process,代码行数:17,代码来源:ProcessManagementServiceClient.java

示例9: login

import org.apache.axis2.client.Options; //导入方法依赖的package包/类
public boolean login(HttpServletRequest request, String username, String password) throws java.lang.Exception {
    log.info("Logging into " + backendServerURL);
    Login loginRequest = new Login();
    loginRequest.setUsername(username);
    loginRequest.setPassword(password);
    loginRequest.setRemoteAddress(request.getRemoteAddr());
    Options option = stub._getServiceClient().getOptions();
    option.setManageSession(true);
    boolean isLoggedIn = false;
    try {
        isLoggedIn = stub.login(username, password, request.getRemoteAddr());
        if (isLoggedIn) {
            String cookie =
                    (String) stub._getServiceClient().getServiceContext().
                            getProperty(HTTPConstants.COOKIE_STRING);
            HttpSession session = request.getSession();
            session.setAttribute(ServerConstants.ADMIN_SERVICE_COOKIE, cookie);
        }
    } catch (java.lang.Exception e) {
        String msg = MessageFormat.format(bundle.getString("cannot.login.to.server"),
                                          backendServerURL);
        handleException(msg, e);
    }

    return isLoggedIn;
}
 
开发者ID:wso2,项目名称:carbon-commons,代码行数:27,代码来源:AuthenticationAdminClient.java

示例10: ListMetadataServiceClient

import org.apache.axis2.client.Options; //导入方法依赖的package包/类
public ListMetadataServiceClient(
        String cookie, String backendServerURL, ConfigurationContext configContext)
        throws RegistryException {

    epr = backendServerURL + "ListMetadataService";

    try {
        stub = new ListMetadataServiceStub(configContext, epr);

        ServiceClient client = stub._getServiceClient();
        Options option = client.getOptions();
        option.setManageSession(true);
        option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);

    } catch (AxisFault axisFault) {
        String msg = "Failed to initiate ListMetadataServices service client. " + axisFault.getMessage();
        log.error(msg, axisFault);
        throw new RegistryException(msg, axisFault);
    }
}
 
开发者ID:wso2,项目名称:carbon-governance,代码行数:21,代码来源:ListMetadataServiceClient.java

示例11: LifecycleServiceClient

import org.apache.axis2.client.Options; //导入方法依赖的package包/类
public LifecycleServiceClient (
        String cookie, String backendServerURL, ConfigurationContext configContext)
        throws RegistryException {

    epr = backendServerURL + "CustomLifecyclesChecklistAdminService";

    try {
        stub = new CustomLifecyclesChecklistAdminServiceStub(configContext, epr);

        ServiceClient client = stub._getServiceClient();
        Options option = client.getOptions();
        option.setManageSession(true);
        option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);

    } catch (AxisFault axisFault) {
        String msg = "Failed to initiate history service client. " + axisFault.getMessage();
        log.error(msg, axisFault);
        throw new RegistryException(msg, axisFault);
    }
}
 
开发者ID:wso2,项目名称:carbon-governance,代码行数:21,代码来源:LifecycleServiceClient.java

示例12: RegistryAdminServiceClient

import org.apache.axis2.client.Options; //导入方法依赖的package包/类
public RegistryAdminServiceClient(ServletConfig config, HttpSession session)
        throws RegistryException {

    String cookie = (String)session.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
    String backendServerURL = CarbonUIUtil.getServerURL(config.getServletContext(), session);
    ConfigurationContext configContext = (ConfigurationContext) config.
            getServletContext().getAttribute(CarbonConstants.CONFIGURATION_CONTEXT);
    epr = backendServerURL + "RegistryAdminService";

    try {
        stub = new RegistryAdminServiceStub(configContext, epr);

        ServiceClient client = stub._getServiceClient();
        Options option = client.getOptions();
        option.setManageSession(true);
        option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);

    } catch (AxisFault axisFault) {
        String msg = "Failed to initiate resource service client. " + axisFault.getMessage();
        log.error(msg, axisFault);
        throw new RegistryException(msg, axisFault);
    }
}
 
开发者ID:wso2,项目名称:carbon-registry,代码行数:24,代码来源:RegistryAdminServiceClient.java

示例13: initWithCookie

import org.apache.axis2.client.Options; //导入方法依赖的package包/类
private void initWithCookie(String backendServerURL, String cookie, long timeOutInMilliSeconds) throws RegistryException {
    epr = backendServerURL + "WSRegistryService";
            	/*Since user provided the cookie no need to authenticate with username and password*/
    setCookie(cookie);
    try{
        if (CarbonUtils.isRunningOnLocalTransportMode()) {
            stub = new WSRegistryServiceStub(
                    WSClientDataHolder.getInstance().getConfigurationContext(), epr);
        } else {
            stub = new WSRegistryServiceStub(epr);
        }
        ServiceClient client = stub._getServiceClient();
        Options options = client.getOptions();
        options.setManageSession(true);
        options.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);
        stub._getServiceClient().getOptions().setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
        //Increase the time out when sending large attachments
        stub._getServiceClient().getOptions().setTimeOutInMilliSeconds(timeOutInMilliSeconds);
    }catch (Exception axisFault){
        String msg = "Failed to initiate WSRegistry Service client. " + axisFault.getMessage();
        log.error(msg, axisFault);
        throw new RegistryException(msg, axisFault);
    }
}
 
开发者ID:wso2,项目名称:carbon-registry,代码行数:25,代码来源:WSRegistryServiceClient.java

示例14: WSUserStoreManager

import org.apache.axis2.client.Options; //导入方法依赖的package包/类
public WSUserStoreManager(String userName, String password, String serverUrl,
                          ConfigurationContext configCtxt) throws UserStoreException {
    try {

        if (serverUrl != null && !serverUrl.endsWith("/")) {
            serverUrl += "/";
        }

        stub = new RemoteUserStoreManagerServiceStub(configCtxt, serverUrl
                + SERVICE_NAME);

        HttpTransportProperties.Authenticator authenticator = new HttpTransportProperties.Authenticator();
        authenticator.setUsername(userName);
        authenticator.setPassword(password);
        authenticator.setPreemptiveAuthentication(true);

        ServiceClient client = stub._getServiceClient();
        Options option = client.getOptions();
        option.setManageSession(true);
        option.setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE,
                authenticator);
    } catch (AxisFault e) {
        handleException(e.getMessage(), e);
    }
}
 
开发者ID:wso2-attic,项目名称:carbon-identity,代码行数:26,代码来源:WSUserStoreManager.java

示例15: DirectoryServerManagerClient

import org.apache.axis2.client.Options; //导入方法依赖的package包/类
public DirectoryServerManagerClient(String cookie, String url,
                                    ConfigurationContext configContext) throws ServerManagerClientException {
    try {
        stub = new DirectoryServerManagerStub(configContext, url + SERVER_MANAGER_SERVICE);
        ServiceClient client = stub._getServiceClient();
        Options option = client.getOptions();
        option.setManageSession(true);
        option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);
    } catch (AxisFault e) {
        log.error("Unable to instantiate DirectoryServerManagerClient.", e);
        throw new ServerManagerClientException(ServerManagerClientException.INIT_SERVICE_PRINCIPLE_ERROR, e);
    }
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:14,代码来源:DirectoryServerManagerClient.java


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