Package evolaris.framework.smsservices.business.commands

Examples of evolaris.framework.smsservices.business.commands.EventParameters


    // table-driven action evaluation
    UserManager userManager = new UserManager(locale,session);
    User user = userManager.registerUserByMsisdn(Long.parseLong(msisdn), null, invocation.getGroup());
   
    InteractionLogManager interactionLogManager = new InteractionLogManager(locale, session);   
    EventParameters eventParameters = null;
   
    ReceivedSms receivedSms = new ReceivedSms();
    receivedSms.setSender(msisdn);
    receivedSms.setReceiver(invocation.getMsisdn() != null ? Long.toString(invocation.getMsisdn()) : "");
    receivedSms.setOperator("SIMULATOR");
    receivedSms.setContent(executionForm.getMessage());
    receivedSms.setSubject(executionForm.getMmsSubject());
    if (executionForm.getFile() != null && executionForm.getFile().getFileSize() > 0) {
      try {
        receivedSms.setAttachment(new SerialBlob(executionForm.getFile().getFileData()));
        receivedSms.setAttachmentContentType(executionForm.getFile().getContentType());
        receivedSms.setAttachmentName(executionForm.getFile().getFileName());
      } catch (Exception e) {
        LOGGER.error("Creating blob from uploaded file faild.", e);
        throw new BugException("Creating blob from uploaded file faild.", e);
      }
    }
   
    receivedSms.setInvocation(invocation);
    SmsDbManager smsMgr = new SmsDbManager(locale, session);
    smsMgr.writeIncomingMessageLog(receivedSms);
    eventParameters = new SmsEventParameters(locale, session, user, invocation, receivedSms);
    InteractionLog log = new InteractionLog();
    eventParameters.updateInteractionLog(log);
    log.setOperation(InteractionLogManager.EVENT_SMS_SIMULATED);
    log.setParameter(executionForm.getMessage());
    interactionLogManager.writeInteractionLog(log);   
   
    interactionLogManager.writeInteractionLog(log);   
View Full Code Here


            try {
              session.load(invocation,invocation.getId())// reload because from different session; this may actually fail if the invocation entry was deleted

              UserManager userManager = new UserManager(Locale.GERMAN,session);
              User user;
              EventParameters eventParameters = null;
              InteractionLogManager interactionLogManager = new InteractionLogManager(Locale.GERMAN, session);
              InteractionLog log = new InteractionLog();

              if(messageObject instanceof ReceivedSms) {
                ReceivedSms sms = (ReceivedSms)messageObject;
                LOGGER.info("sms message: `" + sms.getContent() + "`; sender: " + sms.getSender() + "; invocationId: " + invocation.getId() + " (keyword=`" + invocation.getKeywords() + "`)");
                user = userManager.registerUserByMsisdn(Long.parseLong(sms.getSender()), sms.getOperator(), invocation.getGroup());
                eventParameters = new SmsEventParameters(Locale.GERMAN,session,user,invocation,sms);
                eventParameters.updateInteractionLog(log);
                interactionLogManager.writeInteractionLog(log);

              } else if(messageObject instanceof ReceivedEmail) {
                ReceivedEmail email = (ReceivedEmail)messageObject;
                LOGGER.info("email message: `" + email.getContent() + "`; subject: " + email.getSubject() + "`; sender: " + email.getEmailSender() + "; invocationId: " + invocation.getId() + " (keyword=`" + invocation.getKeywords() + "`)");
                user = userManager.registerUserByEmail(email.getEmailSender(), invocation.getGroup());
                eventParameters = new EmailEventParameters(Locale.GERMAN,session,user,invocation, email);
                eventParameters.updateInteractionLog(log);
                interactionLogManager.writeInteractionLog(log);
              } else {
                throw new BugException("unsupported message type: " + messageObject.getClass().getName());
              }
View Full Code Here

      boolean listWithinLoop, boolean contactAvailableWithinList, String operationPrefix,int enclosingIndentation,SortLabelStack sortLabelStack) {

    if (sortLabelStack.size() > MacroCommand.MAX_FRAGMENT_NESTING_LEVEL){
      return null;
    }
    EventParameters eventParameters = dummyEventParametersForList(req);
    SortLabel breakLabel = null;
    SortLabel loopLabel = null;
    SortLabel contactAssignLabel = null;
    List<DisplayableInteractionContent> interactionList = new ArrayList<DisplayableInteractionContent>();
    CommandEntry previousCommandEntry = null;
View Full Code Here

TOP

Related Classes of evolaris.framework.smsservices.business.commands.EventParameters

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.