Package org.serviceconnector.service

Examples of org.serviceconnector.service.Service


   * @return the publish service
   * @throws SCMPCommandException
   *             the SCMP command exception
   */
  protected PublishService validatePublishService(String serviceName) throws SCMPCommandException {
    Service service = this.getService(serviceName);
    return this.validatePublishService(service);
  }
View Full Code Here


   * @return the publish service
   * @throws SCMPCommandException
   *             the SCMP command exception
   */
  protected FileService validateFileService(String serviceName) throws SCMPCommandException {
    Service service = this.getService(serviceName);
    if (service.getType() != ServiceType.FILE_SERVICE) {
      // service is not file service
      SCMPCommandException scmpCommandException = new SCMPCommandException(SCMPError.V_WRONG_SERVICE_TYPE, serviceName
          + " is not file service");
      scmpCommandException.setMessageType(getKey());
      throw scmpCommandException;
View Full Code Here

   * @return the stateful service
   * @throws SCMPCommandException
   *             the SCMP command exception
   */
  protected StatefulService getStatefulService(String serviceName) throws SCMPCommandException {
    Service service = this.getService(serviceName);

    switch (service.getType()) {
    case PUBLISH_SERVICE:
    case SESSION_SERVICE:
    case CACHE_GUARDIAN:
      break;
    default:
View Full Code Here

  public void run(IRequest request, IResponse response, IResponderCallback responderCallback) throws Exception {
    SCMPMessage reqMessage = request.getMessage();
    String serviceName = reqMessage.getServiceName();
    int oti = reqMessage.getHeaderInt(SCMPHeaderAttributeKey.OPERATION_TIMEOUT);
    // check service is present
    Service abstractService = this.getService(serviceName);

    SCCache cache = AppContext.getSCCache();

    switch (abstractService.getType()) {
    case CASCADED_SESSION_SERVICE:
      if (cache.isCacheEnabled()) {
        // try to load response from cache
        SCMPMessage message = cache.tryGetMessageFromCacheOrLoad(reqMessage);
        if (message != null) {
View Full Code Here

  private void executeCascadedService(IRequest request, IResponse response, IResponderCallback responderCallback)
      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

  public void run(IRequest request, IResponse response, IResponderCallback responderCallback) throws Exception {
    SCMPMessage reqMessage = request.getMessage();
    String serviceName = reqMessage.getServiceName();

    // check service is present and enabled
    Service abstractService = this.getService(serviceName);

    String cascSubscriptionId = reqMessage.getHeader(SCMPHeaderAttributeKey.CASCADED_SUBSCRIPTION_ID);
    Subscription cascSubscription = this.getSubscriptionById(cascSubscriptionId);
    String cascadedSCMask = reqMessage.getHeader(SCMPHeaderAttributeKey.CASCADED_MASK);
    // enhance ipAddressList
    String ipAddressList = reqMessage.getHeader(SCMPHeaderAttributeKey.IP_ADDRESS_LIST);
    ipAddressList = ipAddressList + Constants.SLASH + request.getRemoteSocketAddress().getAddress().getHostAddress();
    reqMessage.setHeader(SCMPHeaderAttributeKey.IP_ADDRESS_LIST, ipAddressList);
    int oti = reqMessage.getHeaderInt(SCMPHeaderAttributeKey.OPERATION_TIMEOUT);

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

TOP

Related Classes of org.serviceconnector.service.Service

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.