Package evolaris.framework.async.datamodel

Examples of evolaris.framework.async.datamodel.ReceivedSms


    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);
View Full Code Here


    try {
      if (message instanceof ObjectMessage) {
        ObjectMessage om = (ObjectMessage) message;
        if (om.getObject()!=null) {
          if (om.getObject() instanceof ReceivedSms) {
            ReceivedSms sms = (ReceivedSms) om.getObject();
            //TODO Wo delete this
            System.out.println("sender: "+sms.getSender()+"; content: "+sms.getContent());
            Session session=null;
            try {
             
             
//              System.out.println("|"+sms.getContent()+"|");
             
              String gameIdString=sms.getContent().substring(0,sms.getContent().indexOf(" "));
              String gameScoreString=sms.getContent().substring(sms.getContent().indexOf(" ")+1,sms.getContent().length());
             
//              System.out.println("|"+gameIdString+"|");
//              System.out.println("|"+gameScoreString+"|");
             
              long senderMSIDSN=Long.parseLong(sms.getSender());
              long gameId=Long.parseLong(gameIdString);
              int gameScore=Integer.parseInt(gameScoreString);
             
              session=evolaris.framework.database.util.HibernateSessions.startTransaction(this.getClass());
              GameHiber g=GameDao.findGameHiber(gameId,session);
View Full Code Here

              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) {
View Full Code Here

          } catch (Exception e) {
          }
         
        }

        ReceivedSms sms=new ReceivedSms();
        sms.setSender(msisdn+"");
        sms.setContent(g.getId()+" "+achieved);
       
        //send message to MDB
        sendSMS(req, sms);
       
        MessageBean.setMyMessage(req, ("User "+userFriendlyName+" achieved "+achieved+" point(s) in game "+g.getName()+"."));
        form.reset();

        MessageBean.addSpeedOMeterCheckPoint(req, "point4");
       
        return am.findForward("list");
       
      } else if (req.getParameter("simulateSeveralSMS")!=null) {
        //send several SMSs

        if (!SecurityCenter.canIManualyInsertPlayingResults(webUser.getId(), g,session)) {
          MessageBean.setMyMessage(req, ("Error: Insufficient privileges."));
          form.reset();
          return am.findForward("list");
        }
       
        long[] users={form.getSimulatedUser1(),form.getSimulatedUser2(),form.getSimulatedUser3(),form.getSimulatedUser4(),
              form.getSimulatedUser5(),form.getSimulatedUser6(),form.getSimulatedUser7(),form.getSimulatedUser8(),
              form.getSimulatedUser9(),form.getSimulatedUser10()};
       
        int[] scores={form.getSimulatedScore1(),form.getSimulatedScore2(),form.getSimulatedScore3(),form.getSimulatedScore4(),
            form.getSimulatedScore5(),form.getSimulatedScore6(),form.getSimulatedScore7(),form.getSimulatedScore8(),
            form.getSimulatedScore9(),form.getSimulatedScore10()};
       
        for (int i=0;i<10;i++) {
         
          int achieved=scores[i];
          long msisdn=-1;
          String userFriendlyName=msisdn+"";
         
          if (achieved<0) continue;
         
          //selected user
          if (msisdn==-1) {
            try {
              User u=UserDao.findUser(users[i], session);
              msisdn=u.getMsisdn();
              userFriendlyName=u.getLastName()+" "+u.getFirstName();
            } catch (Exception e) {
            }
          }

          ReceivedSms sms=new ReceivedSms();
          sms.setSender(msisdn+"");
          sms.setContent(g.getId()+" "+achieved);
         
          //send message to MDB
          sendSMS(req, sms);
         
        }
View Full Code Here

TOP

Related Classes of evolaris.framework.async.datamodel.ReceivedSms

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.