Package flex.messaging.messages

Examples of flex.messaging.messages.CommandMessage


    this.context = context;
  }

  public SoapUIAMFConnection login() throws ClientStatusException, ServerStatusException
  {
    CommandMessage commandMessage = createLoginCommandMessage();

    SoapUIAMFConnection amfConnection = new SoapUIAMFConnection();
    amfConnection.connect( endpoint );
    amfConnection.call( ( SubmitContext )context, null, commandMessage );
    logedIn = true;
View Full Code Here


  }

  public static void logout( SubmitContext context )
  {
    SoapUIAMFConnection connection = ( SoapUIAMFConnection )context.getProperty( AMFSubmit.AMF_CONNECTION );
    CommandMessage commandMessage = createLogoutCommandMessage();
    try
    {
      connection.call( ( SubmitContext )context, null, commandMessage );
    }
    catch( ClientStatusException e )
View Full Code Here

  }

  public void logout()
  {
    SoapUIAMFConnection connection = ( SoapUIAMFConnection )context.getProperty( AMFSubmit.AMF_CONNECTION );
    CommandMessage commandMessage = createLogoutCommandMessage();
    try
    {
      connection.call( ( SubmitContext )context, null, commandMessage );
    }
    catch( ClientStatusException e )
View Full Code Here

    }
  }

  private CommandMessage createLoginCommandMessage()
  {
    CommandMessage commandMessage = new CommandMessage();
    commandMessage.setOperation( CommandMessage.LOGIN_OPERATION );

    String credString = username + ":" + password;
    Encoder encoder = new Encoder( credString.length() );
    encoder.encode( credString.getBytes() );

    commandMessage.setBody( encoder.drain() );
    commandMessage.setDestination( DESTINATION );
    return commandMessage;
  }
View Full Code Here

    return commandMessage;
  }

  private static CommandMessage createLogoutCommandMessage()
  {
    CommandMessage commandMessage = new CommandMessage();
    commandMessage.setOperation( CommandMessage.LOGOUT_OPERATION );
    commandMessage.setDestination( DESTINATION );
    return commandMessage;
  }
View Full Code Here

                                    // If the MessageClient isn't attempting client notification, override
                                    // and do so in this case to suppress the next poll request from the remote client
                                    // which will fail triggering an unnecessary channel disconnect on the client.
                                    if (!messageClient.isAttemptingInvalidationClientNotification())
                                    {
                                        CommandMessage msg = new CommandMessage();
                                        msg.setClientId(messageClient.getClientId());
                                        msg.setOperation(CommandMessage.SUBSCRIPTION_INVALIDATE_OPERATION);
                                        List messages = flushResult.getMessages();
                                        if (messages == null)
                                            messages = new ArrayList(1);
                                        messages.add(msg);
                                    }
View Full Code Here

                    }
                    FlushResult flushResult = client.getFlexClient().poll(client);
                    List messagesToReturn = (flushResult != null) ? flushResult.getMessages() : null;
                    if (messagesToReturn != null && !messagesToReturn.isEmpty())
                    {
                        replyMessage = new CommandMessage(CommandMessage.CLIENT_SYNC_OPERATION);
                        replyMessage.setBody(messagesToReturn.toArray());
                    }
                    else
                    {
                        replyMessage = new AcknowledgeMessage();
View Full Code Here

                // or preceded by other messages in the batch; the request-response loop must complete without waiting.
                // If the poll command is the only message in the batch it's OK to wait.
                // If it isn't OK to wait, tag the poll message with a header that short-circuits any potential poll-wait.
                if (inMessage instanceof CommandMessage)
                {
                    CommandMessage command = (CommandMessage)inMessage;
                    if ((command.getOperation() == CommandMessage.POLL_OPERATION) && (context.getRequestMessage().getBodyCount() != 1))
                        command.setHeader(CommandMessage.SUPPRESS_POLL_WAIT_HEADER, Boolean.TRUE);
                }           
               
                // If MPI is enabled update the MPI metrics on the object referred to by the context
                // and the messages
                if (context.isMPIenabled())           
View Full Code Here

            // or preceeded by other messages in the batch; the request-response loop must complete without waiting.
            // If the poll command is the only message in the batch it's ok to wait.
            // If it isn't ok to wait, tag the poll message with a header that short-circuits any potential poll-wait.
            if (inMessage instanceof CommandMessage)
            {
                CommandMessage command = (CommandMessage)inMessage;
                if ((command.getOperation() == CommandMessage.POLL_OPERATION) && (context.getRequestMessage().getBodyCount() != 1))
                    command.setHeader(CommandMessage.SUPPRESS_POLL_WAIT_HEADER, Boolean.TRUE);
            }

            // If MPI is enabled update the MPI metrics on the object referred to by the context
            // and the messages
            if (context.isMPIenabled())
View Full Code Here

            message.setHeader(Message.VALIDATE_ENDPOINT_HEADER, Boolean.TRUE);
        message.setHeader(Message.ENDPOINT_HEADER, getId());

        if (message instanceof CommandMessage)
        {
            CommandMessage command = (CommandMessage)message;

            // Apply channel endpoint level constraint; always allow login commands through.
            int operation = command.getOperation();
            if (operation != CommandMessage.LOGIN_OPERATION)
                checkSecurityConstraint(message);

            // Handle general (not Consumer specific) poll requests here.
            // We need to fetch all outbound messages for client subscriptions over this endpoint.
            // We identify these general poll messages by their operation and a null clientId.           
            if (operation == CommandMessage.POLL_OPERATION && message.getClientId() == null)
            {
                verifyFlexClientSupport(command);


                FlexClient flexClient = FlexContext.getFlexClient();
                ack = handleFlexClientPollCommand(flexClient, command);
            }
            else if (operation == CommandMessage.DISCONNECT_OPERATION)
            {
                ack = handleChannelDisconnect(command);
            }
            else if (operation == CommandMessage.TRIGGER_CONNECT_OPERATION)
            {
                ack = new AcknowledgeMessage();
            }
            else
            {
                // Block a subset of commands for legacy clients that need to be recompiled to
                // interop with a 2.5+ server.
                if (operation == CommandMessage.SUBSCRIBE_OPERATION || operation == CommandMessage.POLL_OPERATION)
                    verifyFlexClientSupport(command);

                ack = getMessageBroker().routeCommandToService((CommandMessage) message, this);

                // Look for client advertised features on initial connect.
                if (operation == CommandMessage.CLIENT_PING_OPERATION || operation == CommandMessage.LOGIN_OPERATION)
                {
                    Number clientVersion = (Number)command.getHeader(CommandMessage.MESSAGING_VERSION);
                    handleClientMessagingVersion(clientVersion);

                    // Also respond by advertising the messaging version on the
                    // acknowledgement.
                    ack.setHeader(CommandMessage.MESSAGING_VERSION, new Double(messagingVersion));
View Full Code Here

TOP

Related Classes of flex.messaging.messages.CommandMessage

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.