예제 #1
0
파일: Client.java 프로젝트: Juliens/red5
 /**
  * Allows for reconstruction via CompositeData.
  *
  * @param cd composite data
  * @return Client class instance
  */
 public static Client from(CompositeData cd) {
   Client instance = null;
   if (cd.containsKey("id")) {
     String id = (String) cd.get("id");
     instance = new Client(id, null);
     instance.setCreationTime((Long) cd.get("creationTime"));
     instance.setAttribute(PERMISSIONS, cd.get(PERMISSIONS));
   }
   if (cd.containsKey("attributes")) {
     AttributeStore attrs = (AttributeStore) cd.get("attributes");
     instance.setAttributes(attrs);
   }
   return instance;
 }
 /** {@inheritDoc} */
 @Override
 protected void register(IConnection conn) {
   // We only have one connection per client
   for (IConnection c : getConnections()) {
     unregister(c);
   }
   super.register(conn);
 }
 /** {@inheritDoc} */
 @Override
 protected void unregister(IConnection conn) {
   super.unregister(conn);
 }