本文整理汇总了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;
}
示例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);
}
}
示例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;
}
示例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;
}
示例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;
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}