Package org.red5.server.api

Examples of org.red5.server.api.IClientRegistry


    log.debug("App: {}", testApp);

    TestConnection conn = new TestConnection(host, "/junit", null);
    Red5.setConnectionLocal(conn);

    IClientRegistry reg = context.getClientRegistry();
    IClient client = reg.newClient(null);
    assertTrue("client should not be null", client != null);
    log.debug("{}", client);
    String key = "key";
    String value = "value";
    client.setAttribute(key, value);
View Full Code Here


    setupScopes();
    IScope room5 = ScopeUtils.resolveScope(appScope, "/junit/room1/room4/room5");
    log.debug("Room 5 scope: {}", room5);
    // test section for issue #259
    // a little pre-setup is needed first
    IClientRegistry reg = context.getClientRegistry();
    IClient client = reg.newClient(null);
    TestConnection conn = new TestConnection(host, appPath, client.getId());
    conn.initialize(client);
    Red5.setConnectionLocal(conn);
    assertTrue(conn.connect(room5));
    // their code
View Full Code Here

    log.debug("Connection scope: {}", (connectionScope == null ? "is null" : "not null"));
    // when the scope is null bad things seem to happen, if a null scope is OK then
    // this block will need to be removed - Paul
    if (connectionScope != null) {
      // Get client registry for connection scope
      IClientRegistry clientRegistry = connectionScope.getContext().getClientRegistry();
      log.debug("Client registry: {}", (clientRegistry == null ? "is null" : "not null"));
      if (clientRegistry != null) {
        IClient client = conn.getClient();
        if (client == null) {
          if (!clientRegistry.hasClient(id)) {
              if (conn instanceof RTMPTConnection) {
                log.debug("Creating new client for RTMPT connection");
                // create a new client using the session id as the client's id
                client = new Client(id, (ClientRegistry) clientRegistry);
                clientRegistry.addClient(client);
                // set the client on the connection
                conn.setClient(client);         
              } else if (conn instanceof RTMPConnection) {
                log.debug("Creating new client for RTMP connection");
                // this is a new connection, create a new client to hold it
                client = clientRegistry.newClient(params);
                // set the client on the connection
                conn.setClient(client);
              }
          } else {
            client = clientRegistry.lookupClient(id);
            conn.setClient(client);             
          }
        } else {
          // set the client on the connection
          conn.setClient(client)
View Full Code Here

        if (connectionScope == null) {
            return false;
        }

        // Get client registry for connection scope
        IClientRegistry clientRegistry = connectionScope.getContext().getClientRegistry();
    log.debug("Client registry: {}", (clientRegistry == null ? "is null" : "not null"));

        // Get client from registry by id or create a new one
        IClient client = clientRegistry.hasClient(id) ? clientRegistry.lookupClient(id) : clientRegistry.newClient(params);

    // We have a context, and a client object.. time to init the connection.
    conn.initialize(client);

    // we could checked for banned clients here
View Full Code Here

  }

  public RoomClient checkForRecording(){
    try {
     
      IConnection current = Red5.getConnectionLocal();
      String streamid = current.getClient().getId();
     
      log.debug("getCurrentRoomClient -2- "+streamid);
     
      RoomClient currentClient = this.clientListManager.getClientByStreamId(streamid);
     
View Full Code Here

  }
 
  public String recordMeetingStream(String roomRecordingName, String comment, Boolean isInterview){
    try {
     
      IConnection current = Red5.getConnectionLocal();
      RoomClient currentClient = this.clientListManager.getClientByStreamId(current.getClient().getId());
      Long room_id = currentClient.getRoom_id();

      Date now = new Date();
     
      //Receive flvRecordingId
      Long flvRecordingId = this.flvRecordingDaoImpl.addFlvRecording("", roomRecordingName, null, currentClient.getUser_id(),
                  room_id, now, null, currentClient.getUser_id(), comment, currentClient.getStreamid(),
                  currentClient.getVWidth(),currentClient.getVHeight(), isInterview);
     
      //Update Client and set Flag
      currentClient.setIsRecording(true);
      currentClient.setFlvRecordingId(flvRecordingId);
      this.clientListManager.updateClientByStreamId(current.getClient().getId(), currentClient);
     
      //get all stream and start recording them
      Collection<Set<IConnection>> conCollection = current.getScope().getConnections();
      for (Set<IConnection> conset : conCollection) {
        for (IConnection conn : conset) {
          if (conn != null) {
            if (conn instanceof IServiceCapableConnection) {
              RoomClient rcl = this.clientListManager.getClientByStreamId(conn.getClient().getId());
View Full Code Here

    return new Long(-1);
  }
 
  public RoomClient checkLzRecording() {
    try {
      IConnection current = Red5.getConnectionLocal();
      String streamid = current.getClient().getId();
     
      log.debug("getCurrentRoomClient -2- "+streamid);
     
      RoomClient currentClient = this.clientListManager.getClientByStreamId(streamid);
     
View Full Code Here

    return users;
  }

  public RoomClient getCurrentRoomClient(String SID) {
    try {
      IConnection current = Red5.getConnectionLocal();
      String streamid = current.getClient().getId();

      log.debug("getCurrentRoomClient -1- " + SID);
      log.debug("getCurrentRoomClient -2- " + streamid);

      RoomClient currentClient = this.clientListManager
View Full Code Here

  public Users loginByRemember(String SID, String remoteHashId) {
    try {

      RoomClient currentClient;
      IConnection current = Red5.getConnectionLocal();

      Users o = null;

      currentClient = this.clientListManager.getClientByStreamId(current
          .getClient().getId());

      o = Usermanagement.getInstance().loginUserByRemoteHash(SID,
          remoteHashId);

      if (o == null)
        return null;

      if (o.getOrganisation_users() == null) {
        throw new Exception("Users has no organization assigned");
      }

      o.setSessionData(Sessionmanagement.getInstance().getSessionByHash(
          remoteHashId));

      if (currentClient.getUser_id() != null
          && currentClient.getUser_id() > 0) {

        currentClient.setFirstname(o.getFirstname());
        currentClient.setLastname(o.getLastname());

        Collection<Set<IConnection>> conCollection = current.getScope()
            .getConnections();
        for (Set<IConnection> conset : conCollection) {
          for (IConnection cons : conset) {
            if (cons != null) {
              RoomClient rcl = this.clientListManager
View Full Code Here

    try {
      log.warn("loginUser: " + SID + " " + usernameOrEmail);

      RoomClient currentClient;
      IConnection current = Red5.getConnectionLocal();

      Object o;

      if (withLdap) {
        log.debug("Ldap Login");

        currentClient = this.clientListManager
            .getClientByStreamId(current.getClient().getId());

        // LDAP Loggedin Users cannot use the permanent Login Flag

        LdapConfig ldapConfig = LdapConfigDaoImpl.getInstance()
            .getLdapConfigById(ldapConfigId);

        String ldapLogin = usernameOrEmail;
        if (ldapConfig.getAddDomainToUserName() != null
            && ldapConfig.getAddDomainToUserName()) {
          ldapLogin = usernameOrEmail + "@" + ldapConfig.getDomain();
        }

        o = LdapLoginManagement.getInstance().doLdapLogin(ldapLogin,
            Userpass, currentClient, SID,
            ldapConfig.getConfigFileName());
      } else {

        currentClient = this.clientListManager
            .getClientByStreamId(current.getClient().getId());

        o = Usermanagement.getInstance().loginUser(SID,
            usernameOrEmail, Userpass, currentClient,
            storePermanent);
      }

      if (o == null)
        return null;

      if (!o.getClass().isAssignableFrom(Users.class))
        return o;

      if (currentClient.getUser_id() != null
          && currentClient.getUser_id() > 0) {

        Users u = (Users) o;
        currentClient.setFirstname(u.getFirstname());
        currentClient.setLastname(u.getLastname());

        Collection<Set<IConnection>> conCollection = current.getScope()
            .getConnections();
        for (Set<IConnection> conset : conCollection) {
          for (IConnection cons : conset) {
            if (cons != null) {
              RoomClient rcl = this.clientListManager
View Full Code Here

TOP

Related Classes of org.red5.server.api.IClientRegistry

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.