AeroGear SimplePush Server Netty 0.11.0

org.jboss.aerogear.simplepush.server.netty
Class UserAgents

java.lang.Object
  extended by org.jboss.aerogear.simplepush.server.netty.UserAgents

public class UserAgents
extends Object

Represents a mapping of connected UserAgents in a SimplePush Server.


Method Summary
 void add(String uaid, org.jboss.aerogear.io.netty.handler.codec.sockjs.SockJsSessionContext session)
          Adds the a new UserAgent "session".
 Collection<UserAgent<org.jboss.aerogear.io.netty.handler.codec.sockjs.SockJsSessionContext>> all()
          Returns all the UserAgents.
 boolean contains(String uaid)
          Determines if a UserAgent exists for the passed-in user agent identifier.
 UserAgent<org.jboss.aerogear.io.netty.handler.codec.sockjs.SockJsSessionContext> get(String uaid)
          Returns the UserAgent for the specified user agent identifier.
static UserAgents getInstance()
          Returns the singleton instance.
 void updateAccessedTime(String uaid)
          Updates the timestamp for the UserAgent matching the passed-in user agent identifier.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static UserAgents getInstance()
Returns the singleton instance.

Returns:
UserAgents the singleton instance.

add

public void add(String uaid,
                org.jboss.aerogear.io.netty.handler.codec.sockjs.SockJsSessionContext session)
Adds the a new UserAgent "session".

Parameters:
uaid - the unique identifier for the UserAgent.
session - the SockJsSessionContext for the connected UserAgent.

get

public UserAgent<org.jboss.aerogear.io.netty.handler.codec.sockjs.SockJsSessionContext> get(String uaid)
Returns the UserAgent for the specified user agent identifier.

Parameters:
uaid - the UserAgent id.
Returns:
UserAgent matching the passed in user agent identifier.

all

public Collection<UserAgent<org.jboss.aerogear.io.netty.handler.codec.sockjs.SockJsSessionContext>> all()
Returns all the UserAgents.

Returns:
Collection<UserAgent> all the UserAgent.

contains

public boolean contains(String uaid)
Determines if a UserAgent exists for the passed-in user agent identifier.

Parameters:
uaid - the user agent identifier.
Returns:
true if a UserAgent exists, or false otherwise.

updateAccessedTime

public void updateAccessedTime(String uaid)
Updates the timestamp for the UserAgent matching the passed-in user agent identifier. If the UserAgent does not exist nothing is performed.

Parameters:
uaid - the user agent identifier to update.

AeroGear SimplePush Server Netty 0.11.0

Copyright © 2014 JBoss by Red Hat. All Rights Reserved.