Codota Logo
TransportSender.init
Code IndexAdd Codota to your IDE (free)

How to use
init
method
in
org.apache.axis2.transport.TransportSender

Best Java code snippets using org.apache.axis2.transport.TransportSender.init (Showing top 20 results out of 315)

  • Common ways to obtain TransportSender
private void myMethod () {
TransportSender t =
  • Codota IconTransportOutDescription transportOutDescription;transportOutDescription.getSender()
  • Smart code suggestions by Codota
}
origin: org.wso2.carbon.identity.agent.entitlement.mediator/org.wso2.carbon.identity.entitlement.proxy

private EntitlementServiceStub getEntitlementStub(String serverUrl) throws Exception {
  if (entitlementStub.containsKey(serverUrl)) {
    return entitlementStub.get(serverUrl);
  }
  EntitlementServiceStub stub;
  ConfigurationContext configurationContext = ConfigurationContextFactory.createDefaultConfigurationContext();
  Map<String, TransportOutDescription> transportsOut = configurationContext
      .getAxisConfiguration().getTransportsOut();
  for (TransportOutDescription transportOutDescription : transportsOut.values()) {
    transportOutDescription.getSender().init(configurationContext, transportOutDescription);
  }
  stub = new EntitlementServiceStub(configurationContext, serverUrl + "EntitlementService");
  entitlementStub.put(serverUrl, stub);
  return stub;
}
origin: org.wso2.carbon.identity/org.wso2.carbon.identity.entitlement.proxy

private EntitlementServiceStub getEntitlementStub(String serverUrl) throws Exception {
  if (entitlementStub.containsKey(serverUrl)) {
    return entitlementStub.get(serverUrl);
  }
  EntitlementServiceStub stub;
  ConfigurationContext configurationContext = ConfigurationContextFactory.createDefaultConfigurationContext();
  Map<String, TransportOutDescription> transportsOut = configurationContext
      .getAxisConfiguration().getTransportsOut();
  for (TransportOutDescription transportOutDescription : transportsOut.values()) {
    transportOutDescription.getSender().init(configurationContext, transportOutDescription);
  }
  stub = new EntitlementServiceStub(configurationContext, serverUrl + "EntitlementService");
  entitlementStub.put(serverUrl, stub);
  return stub;
}
origin: org.wso2.carbon.identity/org.wso2.carbon.identity.entitlement.proxy

private EntitlementPolicyAdminServiceStub getEntitlementAdminStub(String serverUrl)
    throws Exception {
  if (policyAdminStub.containsKey(serverUrl)) {
    return policyAdminStub.get(serverUrl);
  }
  EntitlementPolicyAdminServiceStub stub;
  ConfigurationContext configurationContext = ConfigurationContextFactory.createDefaultConfigurationContext();
  Map<String, TransportOutDescription> transportsOut = configurationContext
      .getAxisConfiguration().getTransportsOut();
  for (TransportOutDescription transportOutDescription : transportsOut.values()) {
    transportOutDescription.getSender().init(configurationContext, transportOutDescription);
  }
  stub = new EntitlementPolicyAdminServiceStub(configurationContext, serverUrl
      + "EntitlementPolicyAdminService");
  policyAdminStub.put(serverUrl, stub);
  return stub;
}
origin: org.wso2.carbon.identity.agent.entitlement.mediator/org.wso2.carbon.identity.entitlement.proxy

private EntitlementPolicyAdminServiceStub getEntitlementAdminStub(String serverUrl)
    throws Exception {
  if (policyAdminStub.containsKey(serverUrl)) {
    return policyAdminStub.get(serverUrl);
  }
  EntitlementPolicyAdminServiceStub stub;
  ConfigurationContext configurationContext = ConfigurationContextFactory.createDefaultConfigurationContext();
  Map<String, TransportOutDescription> transportsOut = configurationContext
      .getAxisConfiguration().getTransportsOut();
  for (TransportOutDescription transportOutDescription : transportsOut.values()) {
    transportOutDescription.getSender().init(configurationContext, transportOutDescription);
  }
  stub = new EntitlementPolicyAdminServiceStub(configurationContext, serverUrl
      + "EntitlementPolicyAdminService");
  policyAdminStub.put(serverUrl, stub);
  return stub;
}
origin: org.apache.axis2/axis2-kernel

/**
 * Initializes TransportSenders and TransportListeners with appropriate configuration information
 *
 * @param configContext : ConfigurationContext
 */
private static void initTransportSenders(ConfigurationContext configContext) {
  AxisConfiguration axisConf = configContext.getAxisConfiguration();
  // Initialize Transport Outs
  HashMap transportOuts = axisConf.getTransportsOut();
  Iterator values = transportOuts.values().iterator();
  while (values.hasNext()) {
    TransportOutDescription transportOut = (TransportOutDescription) values.next();
    TransportSender sender = transportOut.getSender();
    if (sender != null) {
      try {
        sender.init(configContext, transportOut);
      } catch (AxisFault axisFault) {
        log.info(Messages.getMessage("transportiniterror", transportOut.getName()));
      }
    }
  }
}
origin: apache/axis2-java

/**
 * Initializes TransportSenders and TransportListeners with appropriate configuration information
 *
 * @param configContext : ConfigurationContext
 */
private static void initTransportSenders(ConfigurationContext configContext) {
  AxisConfiguration axisConf = configContext.getAxisConfiguration();
  // Initialize Transport Outs
  HashMap transportOuts = axisConf.getTransportsOut();
  Iterator values = transportOuts.values().iterator();
  while (values.hasNext()) {
    TransportOutDescription transportOut = (TransportOutDescription) values.next();
    TransportSender sender = transportOut.getSender();
    if (sender != null) {
      try {
        sender.init(configContext, transportOut);
      } catch (AxisFault axisFault) {
        log.info(Messages.getMessage("transportiniterror", transportOut.getName()));
      }
    }
  }
}
origin: org.wso2.carbon.identity/org.wso2.carbon.identity.entitlement.proxy

private void initConfigurationContext() throws Exception {
  HttpConnectionManager multiThreadedHttpConnectionManager = new MultiThreadedHttpConnectionManager();
  HttpClient httpClient = new HttpClient(multiThreadedHttpConnectionManager);
  File configFile = new File(DEFAULT_AXIS2_XML);
  if (!configFile.exists()) {
    configurationContext = ConfigurationContextFactory.createDefaultConfigurationContext();
    configurationContext.setProperty(HTTPConstants.DEFAULT_MAX_CONNECTIONS_PER_HOST, MAX_CONNECTIONS_PER_HOST);
  } else {
    configurationContext = ConfigurationContextFactory.
        createConfigurationContextFromFileSystem(DEFAULT_CLIENT_REPO, DEFAULT_AXIS2_XML);
  }
  configurationContext.setProperty(HTTPConstants.CACHED_HTTP_CLIENT, httpClient);
  configurationContext.setProperty(HTTPConstants.REUSE_HTTP_CLIENT, Constants.VALUE_TRUE);
  Map<String, TransportOutDescription> transportsOut =
      configurationContext.getAxisConfiguration().getTransportsOut();
  for (TransportOutDescription transportOutDescription : transportsOut.values()) {
    if (Constants.TRANSPORT_HTTP.equals(transportOutDescription.getName()) ||
        Constants.TRANSPORT_HTTPS.equals(transportOutDescription.getName())) {
      transportOutDescription.getSender().init(configurationContext, transportOutDescription);
    }
  }
}
origin: org.wso2.carbon.identity.agent.entitlement.mediator/org.wso2.carbon.identity.entitlement.proxy

private void initConfigurationContext() throws Exception {
  HttpConnectionManager multiThreadedHttpConnectionManager = new MultiThreadedHttpConnectionManager();
  HttpClient httpClient = new HttpClient(multiThreadedHttpConnectionManager);
  File configFile = new File(DEFAULT_AXIS2_XML);
  if (!configFile.exists()) {
    configurationContext = ConfigurationContextFactory.createDefaultConfigurationContext();
    configurationContext.setProperty(HTTPConstants.DEFAULT_MAX_CONNECTIONS_PER_HOST, MAX_CONNECTIONS_PER_HOST);
  } else {
    configurationContext = ConfigurationContextFactory.
        createConfigurationContextFromFileSystem(DEFAULT_CLIENT_REPO, DEFAULT_AXIS2_XML);
  }
  configurationContext.setProperty(HTTPConstants.CACHED_HTTP_CLIENT, httpClient);
  configurationContext.setProperty(HTTPConstants.REUSE_HTTP_CLIENT, Constants.VALUE_TRUE);
  Map<String, TransportOutDescription> transportsOut =
      configurationContext.getAxisConfiguration().getTransportsOut();
  for (TransportOutDescription transportOutDescription : transportsOut.values()) {
    if (Constants.TRANSPORT_HTTP.equals(transportOutDescription.getName()) ||
        Constants.TRANSPORT_HTTPS.equals(transportOutDescription.getName())) {
      transportOutDescription.getSender().init(configurationContext, transportOutDescription);
    }
  }
}
origin: org.apache.axis2.transport/axis2-transport-testkit

public void addTransport(TransportInDescription trpInDesc,
             TransportOutDescription trpDescOut) throws AxisFault {
  cfgCtx.getAxisConfiguration().addTransportIn(trpInDesc);
  if (trpDescOut != null) {
    trpDescOut.getSender().init(cfgCtx, trpDescOut);
    cfgCtx.getAxisConfiguration().addTransportOut(trpDescOut);
  }
}
origin: org.wso2.carbon.identity.userstore.remote/org.wso2.carbon.identity.user.store.remote

/**
 * @param realmConfig
 * @param properties
 * @throws Exception
 */
public CarbonRemoteUserStoreManger(RealmConfiguration realmConfig, Map properties)
    throws Exception {
  ConfigurationContext configurationContext = ConfigurationContextFactory
      .createDefaultConfigurationContext();
  Map<String, TransportOutDescription> transportsOut = configurationContext
      .getAxisConfiguration().getTransportsOut();
  for (TransportOutDescription transportOutDescription : transportsOut.values()) {
    transportOutDescription.getSender().init(configurationContext, transportOutDescription);
  }
  String[] serverUrls = realmConfig.getUserStoreProperty(SERVER_URLS).split(",");
  for (int i = 0; i < serverUrls.length; i++) {
    remoteUserStore = new WSUserStoreManager(
        realmConfig.getUserStoreProperty(REMOTE_USER_NAME),
        realmConfig.getUserStoreProperty(PASSWORD), serverUrls[i],
        configurationContext);
    if (log.isDebugEnabled()) {
      log.debug("Remote Servers for User Management : " + serverUrls[i]);
    }
    remoteServers.put(serverUrls[i], remoteUserStore);
  }
  this.realmConfig = realmConfig;
  domainName = realmConfig.getUserStoreProperty(UserStoreConfigConstants.DOMAIN_NAME);
}
origin: org.apache.axis2/axis2-transport-testkit

public void addTransport(TransportInDescription trpInDesc,
             TransportOutDescription trpDescOut) throws AxisFault {
  cfgCtx.getAxisConfiguration().addTransportIn(trpInDesc);
  if (trpDescOut != null) {
    trpDescOut.getSender().init(cfgCtx, trpDescOut);
    cfgCtx.getAxisConfiguration().addTransportOut(trpDescOut);
  }
}
origin: apache/axis2-java

public void addTransport(TransportInDescription trpInDesc,
             TransportOutDescription trpDescOut) throws AxisFault {
  cfgCtx.getAxisConfiguration().addTransportIn(trpInDesc);
  if (trpDescOut != null) {
    trpDescOut.getSender().init(cfgCtx, trpDescOut);
    cfgCtx.getAxisConfiguration().addTransportOut(trpDescOut);
  }
}
origin: org.wso2.carbon.identity.agent.entitlement.mediator/org.wso2.carbon.identity.entitlement.proxy

private boolean authenticate() throws Exception {
  ConfigurationContext configurationContext;
  configurationContext = ConfigurationContextFactory.createDefaultConfigurationContext();
  Map<String, TransportOutDescription> transportsOut = configurationContext
      .getAxisConfiguration().getTransportsOut();
  for (TransportOutDescription transportOutDescription : transportsOut.values()) {
    transportOutDescription.getSender().init(configurationContext, transportOutDescription);
  }
  boolean isAuthenticated = false;
  if (StringUtils.isNotEmpty(userName) && StringUtils.isNotEmpty(password)) {
    //if authorized cookie is not available authorize using credentials
    AuthenticationAdminStub authAdmin = new AuthenticationAdminStub(configurationContext,
                                    serverUrl);
    isAuthenticated = authAdmin.login(userName, password, "localhost");
    cookie = (String) authAdmin._getServiceClient().getServiceContext()
        .getProperty(HTTPConstants.COOKIE_STRING);
    authAdmin._getServiceClient().cleanupTransport();
  } else if (StringUtils.isNotEmpty(authorizedCookie)) {
    //when authorized cookie is available assign it to local variable
    isAuthenticated = true;
    cookie = authorizedCookie;
  }
  return isAuthenticated;
}
origin: org.wso2.carbon.mediation/org.wso2.carbon.cloud.gateway

private void enableCGTransportSender(AxisConfiguration axisConfig)
    throws Exception {
  CGTransportSender sender = new CGTransportSender();
  TransportOutDescription transportOut =
      new TransportOutDescription(CGConstant.CG_TRANSPORT_NAME);
  transportOut.setSender(sender);
  axisConfig.addTransportOut(transportOut);
  transportOut.getSender().init(getConfigContext(), transportOut);
}
origin: org.wso2.carbon.identity/org.wso2.carbon.identity.entitlement.proxy

private boolean authenticate() throws Exception {
  ConfigurationContext configurationContext;
  configurationContext = ConfigurationContextFactory.createDefaultConfigurationContext();
  Map<String, TransportOutDescription> transportsOut = configurationContext
      .getAxisConfiguration().getTransportsOut();
  for (TransportOutDescription transportOutDescription : transportsOut.values()) {
    transportOutDescription.getSender().init(configurationContext, transportOutDescription);
  }
  boolean isAuthenticated = false;
  if (StringUtils.isNotEmpty(userName) && StringUtils.isNotEmpty(password)) {
    //if authorized cookie is not available authorize using credentials
    AuthenticationAdminStub authAdmin = new AuthenticationAdminStub(configurationContext,
                                    serverUrl);
    isAuthenticated = authAdmin.login(userName, password, "localhost");
    cookie = (String) authAdmin._getServiceClient().getServiceContext()
        .getProperty(HTTPConstants.COOKIE_STRING);
    authAdmin._getServiceClient().cleanupTransport();
  } else if (StringUtils.isNotEmpty(authorizedCookie)) {
    //when authorized cookie is available assign it to local variable
    isAuthenticated = true;
    cookie = authorizedCookie;
  }
  return isAuthenticated;
}
origin: apache/axis2-java

public void testInit() throws AxisFault {
  ConfigurationContext confContext = ConfigurationContextFactory
      .createEmptyConfigurationContext();
  TransportOutDescription transportOut = new TransportOutDescription("http");
  TransportSender sender = getTransportSender();
  sender.init(confContext, transportOut);
}
origin: org.apache.stratos/org.apache.stratos.cli

/**
 * Initialize the rest client and set username and password of the user
 *
 * @param serverURL server URL
 * @param username  username
 * @param password  password
 * @throws AxisFault
 */
private void initializeRestClient(String serverURL, String username, String password) throws AxisFault {
  HttpTransportProperties.Authenticator authenticator = new HttpTransportProperties.Authenticator();
  authenticator.setUsername(username);
  authenticator.setPassword(password);
  authenticator.setPreemptiveAuthentication(true);
  ConfigurationContext configurationContext;
  try {
    configurationContext = ConfigurationContextFactory.createDefaultConfigurationContext();
  } catch (Exception e) {
    String msg = "Backend error occurred. Please contact the service admins!";
    throw new AxisFault(msg, e);
  }
  HashMap<String, TransportOutDescription> transportsOut = configurationContext
      .getAxisConfiguration().getTransportsOut();
  for (TransportOutDescription transportOutDescription : transportsOut.values()) {
    transportOutDescription.getSender().init(configurationContext, transportOutDescription);
  }
  this.restClient = new RestClient(serverURL, username, password);
}
origin: apache/axis2-java

headerList.add(header2);
msgContext.setProperty(HTTPConstants.HTTP_HEADERS, headerList);
sender.init(confContext, transportOut);
InvocationResponse inResponse = sender.invoke(msgContext);
assertEquals("Not the expected InvocationResponse", InvocationResponse.CONTINUE, inResponse);
origin: org.apache.axis2/axis2-transport-testkit

axisCfg.addTransportOut(trpOutDesc);
sender = trpOutDesc.getSender();
sender.init(cfgCtx, trpOutDesc);
origin: org.apache.axis2.transport/axis2-transport-testkit

axisCfg.addTransportOut(trpOutDesc);
sender = trpOutDesc.getSender();
sender.init(cfgCtx, trpOutDesc);
org.apache.axis2.transportTransportSenderinit

Javadoc

Initialize

Popular methods of TransportSender

  • cleanup
    Release resources associated with a given message context. This method is called after processing th
  • stop
  • invoke
  • getName

Popular in Java

  • Updating database using SQL prepared statement
  • setScale (BigDecimal)
  • getApplicationContext (Context)
  • getSharedPreferences (Context)
  • KeyStore (java.security)
    This class represents an in-memory collection of keys and certificates. It manages two types of entr
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Locale (java.util)
    A Locale object represents a specific geographical, political, or cultural region. An operation that
  • Collectors (java.util.stream)
  • JComboBox (javax.swing)
  • JList (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now