Package org.red5.server.messaging

Examples of org.red5.server.messaging.ServiceAdapter


        String scopeName = "hibernate";
        if (rcl.getRoom_id() != null) {
          scopeName = rcl.getRoom_id().toString();
        }
        IScope currentScope = ScopeApplicationAdapter.getInstance()
            .getRoomScope(scopeName);
        ScopeApplicationAdapter.getInstance().roomLeaveByScope(rcl,
            currentScope);

        HashMap<Integer, String> messageObj = new HashMap<Integer, String>();
View Full Code Here


         }
         String scopeName = "hibernate";
         if (rcl.getRoom_id() != null) {
           scopeName = rcl.getRoom_id().toString();
         }
         IScope currentScope = this.scopeApplicationAdapter.getRoomScope(scopeName);
         this.scopeApplicationAdapter.roomLeaveByScope(rcl, currentScope);
        
        
         HashMap<Integer,String> messageObj = new HashMap<Integer,String>();
         messageObj.put(0, "kick");
View Full Code Here

          }
          String scopeName = "hibernate";
          if (rcl.getRoom_id() != null) {
            scopeName = rcl.getRoom_id().toString();
          }
          IScope currentScope = this.scopeApplicationAdapter.getRoomScope(scopeName);
         
          HashMap<Integer,String> messageObj = new HashMap<Integer,String>();
          messageObj.put(0, "kick");
         
          this.scopeApplicationAdapter.sendMessageById(messageObj, rcl.getStreamid(), currentScope);
View Full Code Here

    // ------------------------------------------------------------------------

    private void createPlayStream( IPendingServiceCallback callback ) {

        logger.debug( "create play stream" );
        IPendingServiceCallback wrapper = new CreatePlayStreamCallBack( callback );
        invoke( "createStream", null, wrapper );
    }
View Full Code Here

      if (stream.getStreamListeners() != null) {
       
        for (Iterator<IStreamListener> iter = stream.getStreamListeners().iterator();iter.hasNext();) {
         
          IStreamListener iStreamListener = iter.next();
         
          ListenerAdapter listenerAdapter = (ListenerAdapter) iStreamListener;
         
          log.debug("Stream Closing ?? "+listenerAdapter.getFlvRecordingMetaDataId()+ " " +flvRecordingMetaDataId);
         
View Full Code Here

    String operation = msg.operation;
    log.debug("Operation: {}", operation);

    if (endpoint instanceof ServiceAdapter) {
      log.debug("Endpoint is a ServiceAdapter so message will be invoked");
      ServiceAdapter adapter = (ServiceAdapter) endpoint;
      //the result of the invocation will make up the message body
      result.body = adapter.invoke(msg);
    } else {
      //get arguments
        Object[] args = null;
        try {
          log.debug("Body: {} type: {}", msg.body, msg.body.getClass().getName());
View Full Code Here

      case Constants.POLL_OPERATION: //2
        //send back modifications
        log.debug("Poll: {}", clientId);
        //send back stored updates for this client
        if (registrations.containsKey(clientId)) {
          ServiceAdapter adapter = registrations.get(clientId);
          if (adapter != null) {
            CommandMessage result = new CommandMessage()
            result.setOperation(Constants.CLIENT_SYNC_OPERATION);   
            //result.setCorrelationId(msg.getMessageId());
            //this will be the body of the responding command message
            AsyncMessageExt ext = new AsyncMessageExt();
            ext.setClientId(clientId);
            ext.setCorrelationId(msg.getMessageId());
            ext.setDestination("Red5Chat");
            ext.setBody(adapter.manage(msg));
            /*
            //grab any headers
            Map<String, Object> headers = msg.getHeaders();
            log.debug("Headers: {}", headers);
            if (headers.containsKey(Message.FLEX_CLIENT_ID_HEADER)) {
View Full Code Here

      case Constants.POLL_OPERATION: //2
        //send back modifications
        log.debug("Poll: {}", clientId);
        //send back stored updates for this client
        if (registrations.containsKey(clientId)) {
          ServiceAdapter adapter = registrations.get(clientId);
          if (adapter != null) {
            CommandMessage result = new CommandMessage()
            result.setOperation(Constants.CLIENT_SYNC_OPERATION);   
            //result.setCorrelationId(msg.getMessageId());
            //this will be the body of the responding command message
            AsyncMessageExt ext = new AsyncMessageExt();
            ext.setClientId(clientId);
            ext.setCorrelationId(msg.getMessageId());
            ext.setDestination("Red5Chat");
            ext.setBody(adapter.manage(msg));
            //add as a child (body) of the command message
            result.setBody(new Object[]{ext});   
           
            return result;
          } else {
            log.debug("Adapter was not available");
          }
        }
        break;
       
      case Constants.SUBSCRIBE_OPERATION: //0
        log.debug("Subscribe: {}", clientId);
        //if there is a destination check for an adapter
        if (StringUtils.isNotBlank(destination)) {
            //look-up end-point and register
            if (endpoints.containsKey(destination)) {
              Object endpoint = endpoints.get(destination);
            //if the endpoint is an adapter, try to subscribe
              if (endpoint instanceof ServiceAdapter) {
                ServiceAdapter adapter = (ServiceAdapter) endpoint;
                boolean subscribed = ((Boolean) adapter.manage(msg));
                if (subscribed) {
                  log.debug("Client was subscribed");
                  registerClientToAdapter(clientId, adapter);
                } else {
                  log.debug("Client was not subscribed");
                }
              }
            }
        }
        // Send back registration ok
        break;

      case Constants.UNSUBSCRIBE_OPERATION: //1
        log.trace("Unsubscribe: {}", clientId);
        if (registrations.containsKey(clientId)) {
          ServiceAdapter adapter = registrations.get(clientId);
          boolean unsubscribed = ((Boolean) adapter.manage(msg));
          if (unsubscribed) {
            log.debug("Client was unsubscribed");
            unregisterClientFromAdapter(clientId);
          } else {
            log.debug("Client was not unsubscribed");
View Full Code Here

      result.setClientId(msg.getClientId());
      result.setCorrelationId(msg.getMessageId());
      result.setDestination(msg.getDestination());
      result.setHeaders(headers);
      //get the adapter
      ServiceAdapter adapter = (ServiceAdapter) endpoint;
      //log.debug("Invoke: {}", adapter.invoke(msg));
      Object o = adapter.invoke(msg);
      //the result of the invocation will make up the message body   
      //AsyncMessage ext = new AsyncMessage();
      //ext.setClientId(msg.getClientId());
      //ext.setCorrelationId(result.getMessageId());
      //ext.setBody(o);
View Full Code Here

            if ( !( event instanceof IRTMPEvent ) ) {
                logger.debug( "skipping non rtmp event: " + event );
                return;
            }

            IRTMPEvent rtmpEvent = (IRTMPEvent) event;

            if ( logger.isDebugEnabled() ) {
                // logger.debug("rtmp event: " + rtmpEvent.getHeader() + ", " +
                // rtmpEvent.getClass().getSimpleName());
            }

            if ( !( rtmpEvent instanceof IStreamData ) ) {
                logger.debug( "skipping non stream data" );
                return;
            }

            if ( rtmpEvent.getHeader().getSize() == 0 ) {
                logger.debug( "skipping event where size == 0" );
                return;
            }

            if ( rtmpEvent instanceof VideoData ) {
View Full Code Here

TOP

Related Classes of org.red5.server.messaging.ServiceAdapter

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.