Package org.serviceconnector.server

Examples of org.serviceconnector.server.CascadedSC


      }
      return null;
    }
    if (service instanceof CascadedFileService) {
      CascadedFileService cascadedFileService = (CascadedFileService) service;
      CascadedSC cascadedSC = cascadedFileService.getCascadedSC();
      String host = cascadedSC.getHost();
      int port = cascadedSC.getPortNr();
      String connectionType = cascadedSC.getConnectionType();
      try {
        SCClient localClient = new SCClient(host, port, ConnectionType.getType(connectionType));
        localClient.attach();
        return localClient;
      } catch (Exception e) {
View Full Code Here


    switch (abstractService.getType()) {
    case CASCADED_SESSION_SERVICE:
      // clears message in cache if in loading state
      AppContext.getSCCache().clearLoading(sessionId);
      CascadedSC cascadedSC = ((CascadedSessionService) abstractService).getCascadedSC();
      CommandCascCallback callback = new CommandCascCallback(request, response, responderCallback);
      cascadedSC.deleteSession(reqMessage, callback, oti);
      return;
    case CASCADED_FILE_SERVICE:
      cascadedSC = ((CascadedFileService) abstractService).getCascadedSC();
      callback = new CommandCascCallback(request, response, responderCallback);
      cascadedSC.deleteSession(reqMessage, callback, oti);
      return;
    default:
      // code for other types of services is below
      break;
    }
View Full Code Here

    switch (abstractService.getType()) {
    case CASCADED_PUBLISH_SERVICE:
    case CASCADED_CACHE_GUARDIAN:
      // publish service is cascaded
      CascadedPublishService cascadedPublishService = (CascadedPublishService) abstractService;
      CascadedSC cascadedSC = cascadedPublishService.getCascadedSC();
      // add server to subscription
      tmpSubscription.setServer(cascadedSC);
      // service is cascaded - subscribe is made by a normal client
      SubscribeCommandCallback callback = new SubscribeCommandCallback(request, response, responderCallback, tmpSubscription);
      cascadedSC.cascadedSCSubscribe(cascadedPublishService.getCascClient(), reqMessage, callback, oti);
      return;
    default:
      // code for other types of services is below
      break;
    }
View Full Code Here

    Service abstractService = this.getService(serviceName);
    int oti = message.getHeaderInt(SCMPHeaderAttributeKey.OPERATION_TIMEOUT);

    switch (abstractService.getType()) {
    case CASCADED_FILE_SERVICE:
      CascadedSC cascadedSC = ((CascadedFileService) abstractService).getCascadedSC();
      CommandCascCallback callback = new CommandCascCallback(request, response, responderCallback);
      cascadedSC.serverDownloadFile(message, callback, oti);
      return;
    default:
      // code for other types of services is below
      break;
    }
View Full Code Here

    int eciInMillis = eciInSeconds * Constants.SEC_TO_MILLISEC_FACTOR;
    int oti = reqMessage.getHeaderInt(SCMPHeaderAttributeKey.OPERATION_TIMEOUT);

    switch (abstractService.getType()) {
    case CASCADED_SESSION_SERVICE:
      CascadedSC cascadedSC = ((CascadedSessionService) abstractService).getCascadedSC();
      CommandCascCallback callback = new CommandCascCallback(request, response, responderCallback);
      cascadedSC.createSession(reqMessage, callback, oti);
      return;
    case CASCADED_FILE_SERVICE:
      cascadedSC = ((CascadedFileService) abstractService).getCascadedSC();
      callback = new CommandCascCallback(request, response, responderCallback);
      cascadedSC.createSession(reqMessage, callback, oti);
      return;
    case SESSION_SERVICE:
      // code for type session service is below switch statement
      break;
    case FILE_SERVICE:
View Full Code Here

      throws Exception {
    SCMPMessage reqMessage = request.getMessage();
    String serviceName = reqMessage.getServiceName();
    int oti = reqMessage.getHeaderInt(SCMPHeaderAttributeKey.OPERATION_TIMEOUT);
    Service abstractService = this.getService(serviceName);
    CascadedSC cascadedSC = ((CascadedSessionService) abstractService).getCascadedSC();
    ClnExecuteCommandCascCallback callback = new ClnExecuteCommandCascCallback(request, response, responderCallback);
    cascadedSC.execute(reqMessage, callback, oti);
    return;
  }
View Full Code Here

    switch (abstractService.getType()) {
    case CASCADED_PUBLISH_SERVICE:
    case CASCADED_CACHE_GUARDIAN:
      CascadedPublishService cascadedPublishService = (CascadedPublishService) abstractService;
      // publish service is cascaded
      CascadedSC cascadedSC = cascadedPublishService.getCascadedSC();

      if (cascadedSCMask == null) {
        // unsubscribe made by cascaded SC on behalf of his last client
        this.subscriptionRegistry.removeSubscription(cascSubscription.getId());
        publishMessageQueue.unsubscribe(cascSubscription.getId());
        cascSubscription.getServer().removeSession(cascSubscription);
        SubscriptionLogger.logUnsubscribe(serviceName, cascSubscription.getId());
      } else {
        // unsubscribe made by cascaded SC on behalf of his clients
        SubscriptionMask cascSCMask = new SubscriptionMask(cascadedSCMask);
        publishMessageQueue.changeSubscription(cascSubscription.getId(), cascSCMask);
        cascSubscription.setMask(cascSCMask);
        SubscriptionLogger.logChangeSubscribe(serviceName, cascSubscription.getId(), cascadedSCMask);
      }
      CscUnsubscribeCallbackForCasc callback = new CscUnsubscribeCallbackForCasc(request, response, responderCallback,
          cascSubscription);
      cascadedSC.cascadedSCUnsubscribe(cascadedPublishService.getCascClient(), reqMessage, callback, oti);
      // delete unreferenced nodes in queue
      publishMessageQueue.removeNonreferencedNodes();
      return;
    default:
      // code for other types of services is below
View Full Code Here

    switch (abstractService.getType()) {
    case CASCADED_SESSION_SERVICE:
      // clears message in cache if in loading state
      AppContext.getSCCache().clearLoading(sessionId);
      CascadedSC cascadedSC = ((CascadedSessionService) abstractService).getCascadedSC();
      CommandCascCallback callback = new CommandCascCallback(request, response, responderCallback);
      cascadedSC.deleteSession(reqMessage, callback, oti);
      return;
    case CASCADED_FILE_SERVICE:
      cascadedSC = ((CascadedFileService) abstractService).getCascadedSC();
      callback = new CommandCascCallback(request, response, responderCallback);
      cascadedSC.deleteSession(reqMessage, callback, oti);
      return;
    default:
      // code for other types of services is below
      break;
    }
View Full Code Here

    switch (abstractService.getType()) {
    case CASCADED_PUBLISH_SERVICE:
    case CASCADED_CACHE_GUARDIAN:
      CascadedPublishService cascadedPublishService = (CascadedPublishService) abstractService;
      // publish service is cascaded
      CascadedSC cascadedSC = cascadedPublishService.getCascadedSC();

      PublishMessageQueue<SCMPMessage> queue = ((IPublishService) cascSubscription.getService()).getMessageQueue();
      if (cascadedSCMask == null) {
        // subscription abort made by cascaded SC on behalf of his last client
        this.subscriptionRegistry.removeSubscription(cascSubscription.getId());
        queue.unsubscribe(cascSubscription.getId());
        cascSubscription.getServer().removeSession(cascSubscription);
        SubscriptionLogger.logUnsubscribe(serviceName, cascSubscription.getId());
      } else {
        // unsubscribe made by cascaded SC on behalf of a clients, others are left
        SubscriptionMask cascSCMask = new SubscriptionMask(cascadedSCMask);
        queue.changeSubscription(cascSubscription.getId(), cascSCMask);
        cascSubscription.setMask(cascSCMask);
        SubscriptionLogger.logChangeSubscribe(serviceName, cascSubscription.getId(), cascadedSCMask);
      }
      CscAbortSubscriptionCommandCallback callback = new CscAbortSubscriptionCommandCallback(request, response,
          responderCallback, cascSubscription);
      cascadedSC.cascadedSCAbortSubscription(cascadedPublishService.getCascClient(), reqMessage, callback, oti);
      return;
    default:
      // code for other types of services is below
      break;
    }
View Full Code Here

    switch (abstractService.getType()) {
    case CASCADED_PUBLISH_SERVICE:
    case CASCADED_CACHE_GUARDIAN:
      // publish service is cascaded
      CascadedPublishService cascadedPublishService = (CascadedPublishService) abstractService;
      CascadedSC cascadedSC = cascadedPublishService.getCascadedSC();
      // add server to subscription
      tmpCascSCSubscription.setServer(cascadedSC);

      ISubscriptionCallback callback = null;
      if (cscSubscription == null) {
        // cascaded SC not subscribed yet
        callback = new SubscribeCommandCallback(request, response, responderCallback, tmpCascSCSubscription);
      } else {
        // subscribe is made by an active cascaded SC
        callback = new CscChangeSubscriptionCallbackForCasc(request, response, responderCallback, cscSubscription,
            cscSCMaskString);
      }
      cascadedSC.cascadedSCSubscribe(cascadedPublishService.getCascClient(), reqMessage, callback, oti);
      return;
    default:
      // code for other types of services is below
      break;
    }
View Full Code Here

TOP

Related Classes of org.serviceconnector.server.CascadedSC

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.