Package org.serviceconnector.net.res

Examples of org.serviceconnector.net.res.IResponder


    Paging paging = this.writePagingAttributes(writer, request, responders.length, "");
    // String showSessionsParameter = request.getParameter("showsessions");
    int startIndex = paging.getStartIndex();
    int endIndex = paging.getEndIndex();
    for (int i = startIndex; i < endIndex; i++) {
      IResponder responder = responders[i];
      writer.writeStartElement("responder");
      writer.writeStartElement("responderConfig");
      this.writeBean(writer, responder.getListenerConfig());
      writer.writeEndElement();
      writer.writeStartElement("endPoints");
      List<IEndpoint> endPointList = responder.getEndpoints();
      for (IEndpoint endPoint : endPointList) {
        writer.writeStartElement("endPoint");
        this.writeBean(writer, endPoint);
        writer.writeEndElement();
      }
View Full Code Here


      // httpUrlFileQualifier is an optional attribute
      httpUrlFileQualifier = Constants.SLASH;
    }

    ResponderRegistry responderRegistry = AppContext.getResponderRegistry();
    IResponder responder = responderRegistry.getCurrentResponder();
    ListenerConfiguration listenerConfig = responder.getListenerConfig();
    String connectionType = listenerConfig.getConnectionType();

    RemoteNodeConfiguration remoteNodeConfiguration = new RemoteNodeConfiguration(ServerType.STATEFUL_SERVER, serverKey,
        socketAddress.getHostName(), portNr, connectionType, keepAliveIntervalSeconds, checkRegistrationIntervalSeconds,
        maxConnections, maxSessions, httpUrlFileQualifier);
View Full Code Here

   */
  protected SCClient connectClientToService(Service service) throws WebCommandException {
    ResponderRegistry responderRegistry = AppContext.getResponderRegistry();
    if (service instanceof FileService) {
      // get local service connector listener using sc-tcp
      IResponder responder = responderRegistry.getFirstResponderForConnectionType(ConnectionType.NETTY_TCP);
      if (responder != null) {
        ListenerConfiguration myLocalListenerConfiguration = responder.getListenerConfig();
        List<String> networkInterfaces = myLocalListenerConfiguration.getNetworkInterfaces();
        for (String networkInterface : networkInterfaces) {
          String host = networkInterface;
          int port = myLocalListenerConfiguration.getPort();
          try {
            SCClient localClient = new SCClient(host, port, ConnectionType.NETTY_TCP);
            localClient.attach();
            return localClient;
          } catch (Exception e) {
            LOGGER.warn("upload current log files, connect to network interface " + host + " failed. " + e.toString());
          }
        }
      }
      responder = responderRegistry.getFirstResponderForConnectionType(ConnectionType.NETTY_HTTP);
      if (responder != null) {
        ListenerConfiguration myLocalListenerConfiguration = responder.getListenerConfig();
        List<String> networkInterfaces = myLocalListenerConfiguration.getNetworkInterfaces();
        // no netty tcp endpoint is available, try to get netty http
        for (String networkInterface : networkInterfaces) {
          String host = networkInterface;
          int port = myLocalListenerConfiguration.getPort();
View Full Code Here

    InetSocketAddress localAddress = (InetSocketAddress) channel.getLocalAddress();
    InetSocketAddress remoteAddress = (InetSocketAddress) channel.getRemoteAddress();
    int port = ((InetSocketAddress) channel.getLocalAddress()).getPort();
    responderRegistry.setThreadLocal(port);

    IResponder responder = AppContext.getResponderRegistry().getCurrentResponder();
    ListenerConfiguration respConfig = responder.getListenerConfig();
    String contextUserid = respConfig.getUsername();
    String contextPassword = respConfig.getPassword();
    WebContext.setSCWebCredentials(new WebCredentials(contextUserid, contextPassword));

    HttpRequest httpRequest = (HttpRequest) event.getMessage();
View Full Code Here

    statistics.setStartupDateTime(new Timestamp(Calendar.getInstance().getTime().getTime()));

    // start configured responders
    Map<String, ListenerConfiguration> listenerList = AppContext.getResponderConfiguration().getListenerConfigurations();
    for (ListenerConfiguration listenerConfig : listenerList.values()) {
      IResponder responder = new Responder(listenerConfig);
      responder.create();
      responder.startListenAsync();
    }
    // Write PID file
    if (AppContext.getBasicConfiguration().isWritePID()) {
      String fs = System.getProperty("file.separator");
      FileCtx fileCtx = FileUtility.createPIDfileAndLock(AppContext.getBasicConfiguration().getPidPath() + fs
View Full Code Here

    InetSocketAddress localAddress = (InetSocketAddress) channel.getLocalAddress();
    InetSocketAddress remoteAddress = (InetSocketAddress) channel.getRemoteAddress();
    int port = ((InetSocketAddress) channel.getLocalAddress()).getPort();
    responderRegistry.setThreadLocal(port);

    IResponder responder = AppContext.getResponderRegistry().getCurrentResponder();
    ListenerConfiguration respConfig = responder.getListenerConfig();
    String contextUserid = respConfig.getUsername();
    String contextPassword = respConfig.getPassword();
    WebContext.setSCWebCredentials(new WebCredentials(contextUserid, contextPassword));

    HttpRequest httpRequest = (HttpRequest) event.getMessage();
View Full Code Here

  public void run(IRequest request, IResponse response, IResponderCallback responderCallback) throws SCMPCommandException {
    SCMPMessage reqMessage = request.getMessage();
    String serviceName = reqMessage.getServiceName();
    // look up srvService
    SrvServiceRegistry srvServiceRegistry = AppContext.getSrvServiceRegistry();
    IResponder responder = AppContext.getResponderRegistry().getCurrentResponder();
    int listenerPort = responder.getListenerConfig().getPort();
    SrvService srvService = srvServiceRegistry.getSrvService(serviceName + "_" + listenerPort);
    String sessionId = reqMessage.getSessionId();

    if (srvService == null) {
      // service not available anymore set up reply
View Full Code Here

   */
  protected SCClient connectClientToService(Service service) throws WebCommandException {
    ResponderRegistry responderRegistry = AppContext.getResponderRegistry();
    if (service instanceof FileService) {
      // get local service connector listener using sc-tcp
      IResponder responder = responderRegistry.getFirstResponderForConnectionType(ConnectionType.NETTY_TCP);
      if (responder != null) {
        ListenerConfiguration myLocalListenerConfiguration = responder.getListenerConfig();
        List<String> networkInterfaces = myLocalListenerConfiguration.getNetworkInterfaces();
        for (String networkInterface : networkInterfaces) {
          String host = networkInterface;
          int port = myLocalListenerConfiguration.getPort();
          try {
            SCClient localClient = new SCClient(host, port, ConnectionType.NETTY_TCP);
            localClient.attach();
            return localClient;
          } catch (Exception e) {
            LOGGER.warn("upload current log files, connect to network interface " + host + " failed. " + e.toString());
          }
        }
      }
      responder = responderRegistry.getFirstResponderForConnectionType(ConnectionType.NETTY_HTTP);
      if (responder != null) {
        ListenerConfiguration myLocalListenerConfiguration = responder.getListenerConfig();
        List<String> networkInterfaces = myLocalListenerConfiguration.getNetworkInterfaces();
        // no netty tcp endpoint is available, try to get netty http
        for (String networkInterface : networkInterfaces) {
          String host = networkInterface;
          int port = myLocalListenerConfiguration.getPort();
View Full Code Here

      // httpUrlFileQualifier is an optional attribute
      httpUrlFileQualifier = Constants.SLASH;
    }

    ResponderRegistry responderRegistry = AppContext.getResponderRegistry();
    IResponder responder = responderRegistry.getCurrentResponder();
    ListenerConfiguration listenerConfig = responder.getListenerConfig();
    String connectionType = listenerConfig.getConnectionType();

    RemoteNodeConfiguration remoteNodeConfiguration = new RemoteNodeConfiguration(ServerType.STATEFUL_SERVER, serverKey,
        socketAddress.getHostName(), portNr, connectionType, keepAliveIntervalSeconds, checkRegistrationIntervalSeconds,
        maxConnections, maxSessions, httpUrlFileQualifier);
View Full Code Here

    statistics.setStartupDateTime(new Timestamp(Calendar.getInstance().getTime().getTime()));

    // start configured responders
    Map<String, ListenerConfiguration> listenerList = AppContext.getResponderConfiguration().getListenerConfigurations();
    for (ListenerConfiguration listenerConfig : listenerList.values()) {
      IResponder responder = new Responder(listenerConfig);
      responder.create();
      responder.startListenAsync();
    }
    // Write PID file
    if (AppContext.getBasicConfiguration().isWritePID()) {
      String fs = System.getProperty("file.separator");
      FileCtx fileCtx = FileUtility.createPIDfileAndLock(AppContext.getBasicConfiguration().getPidPath() + fs
View Full Code Here

TOP

Related Classes of org.serviceconnector.net.res.IResponder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.