Package org.serviceconnector.scmp

Examples of org.serviceconnector.scmp.SCMPMessageFault


  public void receive(Exception ex) {
    LOGGER.warn("receive exception sid=" + sid + " " + ex.toString());
    SCMPMessage fault = null;
    if (ex instanceof IdleTimeoutException) {
      // operation timeout handling
      fault = new SCMPMessageFault(SCMPError.OPERATION_TIMEOUT, "Operation timeout expired on SC sid=" + this.sid);
    } else if (ex instanceof IOException) {
      fault = new SCMPMessageFault(SCMPError.CONNECTION_EXCEPTION, "broken connection to server sid=" + this.sid);
    } else {
      fault = new SCMPMessageFault(SCMPError.SC_ERROR, "error executing " + this.msgType + " sid=" + this.sid);
    }
    // caching
    SCCacheManager cacheManager = AppContext.getCacheManager();
    if (cacheManager.isCacheEnabled() == true) {
      cacheManager.cacheMessage(this.requestMessage, fault);
View Full Code Here


    server.removeSession(session);
    SCMPMessage fault = null;
    String serviceName = reqMessage.getServiceName();
    if (ex instanceof IdleTimeoutException) {
      // operation timeout handling
      fault = new SCMPMessageFault(SCMPError.OPERATION_TIMEOUT, "Operation timeout expired on SC delete session sid=" + sid);
    } else if (ex instanceof IOException) {
      fault = new SCMPMessageFault(SCMPError.CONNECTION_EXCEPTION, "broken connection on SC delete session sid=" + sid);
    } else {
      fault = new SCMPMessageFault(SCMPError.SC_ERROR, "executing delete session failed sid=" + sid);
    }
    // forward server reply to client
    fault.setIsReply(true);
    fault.setServiceName(serviceName);
    fault.setMessageType(this.msgType);
View Full Code Here

    server.removeSession(session);
    SCMPMessage fault = null;
    String serviceName = reqMessage.getServiceName();
    if (ex instanceof IdleTimeoutException) {
      // operation timeout handling
      fault = new SCMPMessageFault(SCMPError.OPERATION_TIMEOUT, "Operation timeout expired on SC create session sid=" + sid);
    } else if (ex instanceof IOException) {
      fault = new SCMPMessageFault(SCMPError.CONNECTION_EXCEPTION, "broken connection on SC create session sid=" + sid);
    } else {
      fault = new SCMPMessageFault(SCMPError.SC_ERROR, "executing create session failed sid=" + sid);
    }
    fault.setIsReply(true);
    fault.setServiceName(serviceName);
    fault.setMessageType(this.msgType);
    this.response.setSCMP(fault);
View Full Code Here

    @Override
    public void timeout() {
      LOGGER.warn("oti timeout expiration in sc client API oti=" + this.timeoutMillis);
      this.disconnectConnection(true);
      try {
        SCMPMessageFault fault = new SCMPMessageFault(SCMPError.REQUEST_TIMEOUT, "Operation timeout expired on client");
        fault.setMessageType(requestMsg.getMessageType());
        this.scmpCallback.receive(fault);
      } catch (Exception e) {
        this.scmpCallback.receive(e);
      }
    }
View Full Code Here

    IStatefulServer server = this.subscription.getServer();
    server.removeSession(subscription);
    SCMPMessage fault = null;
    if (ex instanceof IdleTimeoutException) {
      // operation timeout handling
      fault = new SCMPMessageFault(SCMPError.OPERATION_TIMEOUT, "Operation timeout expired on SC cln unsubscribe sid=" + sid);
    } else if (ex instanceof IOException) {
      fault = new SCMPMessageFault(SCMPError.CONNECTION_EXCEPTION, "broken connection on SC cln unsubscribe sid=" + sid);
    } else if (ex instanceof InvalidMaskLengthException) {
      fault = new SCMPMessageFault(SCMPError.HV_WRONG_MASK, ex.getMessage() + "sid=" + sid);
    } else {
      fault = new SCMPMessageFault(SCMPError.SC_ERROR, "executing cln unsubscribe failed sid=" + sid);
    }
    // forward server reply to client
    fault.setIsReply(true);
    fault.setServiceName(serviceName);
    fault.setMessageType(SCMPMsgType.CLN_UNSUBSCRIBE);
View Full Code Here

  public void receive(Exception ex) {
    LOGGER.warn(ex);
    SCMPMessage fault = null;
    if (ex instanceof IdleTimeoutException) {
      // operation timeout handling
      fault = new SCMPMessageFault(SCMPError.OPERATION_TIMEOUT, "Operation timeout expired on SC");
    } else if (ex instanceof IOException) {
      fault = new SCMPMessageFault(SCMPError.CONNECTION_EXCEPTION, "broken connection");
    } else if (ex instanceof ConnectionPoolBusyException) {
      fault = new SCMPMessageFault(ex, SCMPError.NO_FREE_CONNECTION);
    } else {
      fault = new SCMPMessageFault(SCMPError.SC_ERROR, "executing command failed");
    }
    super.receive(fault);
  }
View Full Code Here

    SCMPMessage fault = null;
    SCMPMessage reqMessage = request.getMessage();
    String serviceName = reqMessage.getServiceName();
    if (ex instanceof IdleTimeoutException) {
      // operation timeout handling
      fault = new SCMPMessageFault(SCMPError.OPERATION_TIMEOUT,
          "Operation timeout expired on SC cln change subscription sid=" + sid);
    } else if (ex instanceof IOException) {
      fault = new SCMPMessageFault(SCMPError.CONNECTION_EXCEPTION, "broken connection on SC cln change subscription sid="
          + sid);
    } else if (ex instanceof InvalidMaskLengthException) {
      fault = new SCMPMessageFault(SCMPError.HV_WRONG_MASK, ex.getMessage() + " sid=" + sid);
    } else {
      fault = new SCMPMessageFault(SCMPError.SC_ERROR, "executing cln change subscription failed sid=" + sid);
    }
    fault.setIsReply(true);
    fault.setServiceName(serviceName);
    fault.setMessageType(SCMPMsgType.CLN_CHANGE_SUBSCRIPTION);
    fault.setSessionId(sid);
View Full Code Here

      ConnectionPoolCallback callback = new ConnectionPoolCallback(true);
      connection.send(keepAliveMessage, callback);
      SCMPMessage reply = callback.getMessageSync(this.keepAliveOTIMillis);
      if (reply.isFault() == true) {
        // reply of keep alive is fault
        SCMPMessageFault fault = (SCMPMessageFault) reply;
        LOGGER.error("send keepalive failed - connection gets destroyed, scErrorText="
            + fault.getHeader(SCMPHeaderAttributeKey.SC_ERROR_TEXT) + " scErrorCode="
            + fault.getHeader(SCMPHeaderAttributeKey.SC_ERROR_CODE));
        this.forceClosingConnection(connection, false);
        return;
      }
      synchronized (this) {
        this.usedConnections.remove(connection);
View Full Code Here

    if (Constants.CC_CMD_ENABLE.equalsIgnoreCase(callKey)) {
      // enable services
      boolean success = this.modifyStateOfServices(true, serviceName);
      if (success == false) {
        LOGGER.debug("service=" + serviceName + " not found");
        scmpReply = new SCMPMessageFault(SCMPError.SERVICE_NOT_FOUND, serviceName);
      }
      response.setSCMP(scmpReply);
      responderCallback.responseCallback(request, response);
      return;
    }

    if (Constants.CC_CMD_DISABLE.equalsIgnoreCase(callKey)) {
      // enable services
      boolean success = this.modifyStateOfServices(false, serviceName);
      if (success == false) {
        LOGGER.debug("service=" + serviceName + " not found");
        scmpReply = new SCMPMessageFault(SCMPError.SERVICE_NOT_FOUND, serviceName);
      }
      response.setSCMP(scmpReply);
      responderCallback.responseCallback(request, response);
      return;
    }
    LOGGER.error("wrong manage command body=" + bodyString); // body has bad syntax
    scmpReply = new SCMPMessageFault(SCMPError.V_WRONG_MANAGE_COMMAND, bodyString);
    response.setSCMP(scmpReply);
    // initiate responder to send reply
    responderCallback.responseCallback(request, response);
  }
View Full Code Here

    LOGGER.warn("receive exception sid=" + sid + " " + ex.toString());
    String serviceName = reqMessage.getServiceName();
    SCMPMessage fault = null;
    if (ex instanceof IdleTimeoutException) {
      // operation timeout handling
      fault = new SCMPMessageFault(SCMPError.OPERATION_TIMEOUT, "Operation timeout expired on SC csc abort subscription sid="
          + sid);
    } else if (ex instanceof IOException) {
      fault = new SCMPMessageFault(SCMPError.CONNECTION_EXCEPTION, "broken connection on SC csc abort subscription sid="
          + sid);
    } else {
      fault = new SCMPMessageFault(SCMPError.SC_ERROR, "executing csc abort subscription failed sid=" + sid);
    }
    // forward server reply to client
    fault.setIsReply(true);
    fault.setServiceName(serviceName);
    fault.setMessageType(SCMPMsgType.CSC_ABORT_SUBSCRIPTION);
View Full Code Here

TOP

Related Classes of org.serviceconnector.scmp.SCMPMessageFault

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.