test_class.declarator: offlineProcessor
test_class.modifier: private
test_class.original_string: private OfflineMessages offlineProcessor;
test_class.type: OfflineMessages
test_class.var_name: offlineProcessor
test_class.declarator: msgRepo
test_class.modifier: private
test_class.original_string: private MsgRepositoryIfcImpl msgRepo;
test_class.type: MsgRepositoryIfcImpl
test_class.var_name: msgRepo
test_class.file: tigase-server 7.1.0/src/test/java/tigase/xmpp/impl/OfflineMessagesTest.java
test_class.identifier: OfflineMessagesTest
test_class.superclass: extends ProcessorTestCase
test_case.body: @Test
  	public void testLoadOfflineMessages() throws Exception {
  		BareJID userJid = BareJID.bareJIDInstance("user1@example.com");
  		JID res1 = JID.jidInstance(userJid, "res1");
  		JID res2 = JID.jidInstance(userJid, "res2");
  		XMPPResourceConnection session1 = getSession(JID.jidInstance("c2s@example.com/" + UUID.randomUUID().toString()), res1);
  		XMPPResourceConnection session2 = getSession(JID.jidInstance("c2s@example.com/" + UUID.randomUUID().toString()), res2);
  		
  		assertEquals(Arrays.asList(session1, session2), session1.getActiveSessions());
  		
  		Element presenceEl = new Element("presence", new String[] { "from", "to" }, new String[] { res1.toString(), res2.toString() });
  		Packet packet = Packet.packetInstance(presenceEl);
  		assertFalse(offlineProcessor.loadOfflineMessages(packet, session1));
  		
  		presenceEl = new Element("presence", new String[] { "from" }, new String[] { res1.toString() });
  		packet = Packet.packetInstance(presenceEl);
  		assertTrue(offlineProcessor.loadOfflineMessages(packet, session1));	
  	}
test_case.class_method_signature: OfflineMessagesTest.testLoadOfflineMessages()
test_case.full_signature: @Test public void testLoadOfflineMessages()
test_case.identifier: testLoadOfflineMessages
test_case.invocations: bareJIDInstance jidInstance jidInstance getSession jidInstance toString randomUUID getSession jidInstance toString randomUUID assertEquals asList getActiveSessions toString toString packetInstance assertFalse loadOfflineMessages toString packetInstance assertTrue loadOfflineMessages
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testLoadOfflineMessages()
focal_class.declarator: XMLNS = "jabber:client"
focal_class.modifier: protected static final
focal_class.original_string: protected static final String XMLNS = "jabber:client";
focal_class.type: String
focal_class.var_name: XMLNS
focal_class.declarator: ID = "msgoffline"
focal_class.modifier: private static final
focal_class.original_string: private static final String ID = "msgoffline";
focal_class.type: String
focal_class.var_name: ID
focal_class.declarator: log = Logger.getLogger( OfflineMessages.class.getName() )
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = Logger.getLogger( OfflineMessages.class.getName() );
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: ELEMENTS = {
  		{ PresenceAbstract.PRESENCE_ELEMENT_NAME }, { "iq", "msgoffline" } }
focal_class.modifier: private static final
focal_class.original_string: private static final String[][] ELEMENTS = {
  		{ PresenceAbstract.PRESENCE_ELEMENT_NAME }, { "iq", "msgoffline" } };
focal_class.type: String[][]
focal_class.var_name: ELEMENTS
focal_class.declarator: XMLNSS = { XMLNS, ID }
focal_class.modifier: private static final
focal_class.original_string: private static final String[] XMLNSS = { XMLNS, ID };
focal_class.type: String[]
focal_class.var_name: XMLNSS
focal_class.declarator: DISCO_FEATURES = {
  		new Element( "feature", new String[] { "var" }, new String[] { "msgoffline" } ) }
focal_class.modifier: private static final
focal_class.original_string: private static final Element[] DISCO_FEATURES = {
  		new Element( "feature", new String[] { "var" }, new String[] { "msgoffline" } ) };
focal_class.type: Element[]
focal_class.var_name: DISCO_FEATURES
focal_class.declarator: defHost
focal_class.modifier: private static
focal_class.original_string: private static String defHost;
focal_class.type: String
focal_class.var_name: defHost
focal_class.declarator: MESSAGE_EVENT_PATH = { ELEM_NAME, "event" }
focal_class.modifier: public static final
focal_class.original_string: public static final String[] MESSAGE_EVENT_PATH = { ELEM_NAME, "event" };
focal_class.type: String[]
focal_class.var_name: MESSAGE_EVENT_PATH
focal_class.declarator: MESSAGE_HEADER_PATH = { ELEM_NAME, "header" }
focal_class.modifier: public static final
focal_class.original_string: public static final String[] MESSAGE_HEADER_PATH = { ELEM_NAME, "header" };
focal_class.type: String[]
focal_class.var_name: MESSAGE_HEADER_PATH
focal_class.declarator: MESSAGE_HINTS_NO_STORE = { ELEM_NAME, "no-store" }
focal_class.modifier: public static final
focal_class.original_string: public static final String[] MESSAGE_HINTS_NO_STORE = { ELEM_NAME, "no-store" };
focal_class.type: String[]
focal_class.var_name: MESSAGE_HINTS_NO_STORE
focal_class.declarator: MESSAGE_HINTS_XMLNS = "urn:xmpp:hints"
focal_class.modifier: public static final
focal_class.original_string: public static final String MESSAGE_HINTS_XMLNS = "urn:xmpp:hints";
focal_class.type: String
focal_class.var_name: MESSAGE_HINTS_XMLNS
focal_class.declarator: MESSAGE_RECEIVED_PATH = { ELEM_NAME, "received" }
focal_class.modifier: public static final
focal_class.original_string: public static final String[] MESSAGE_RECEIVED_PATH = { ELEM_NAME, "received" };
focal_class.type: String[]
focal_class.var_name: MESSAGE_RECEIVED_PATH
focal_class.declarator: MESSAGE_RECEIVED_XMLNS = "urn:xmpp:receipts"
focal_class.modifier: public static final
focal_class.original_string: public static final String MESSAGE_RECEIVED_XMLNS = "urn:xmpp:receipts";
focal_class.type: String
focal_class.var_name: MESSAGE_RECEIVED_XMLNS
focal_class.declarator: MSG_OFFLINE_STORAGE_PATHS = "msg-store-offline-paths"
focal_class.modifier: private static final
focal_class.original_string: private static final String MSG_OFFLINE_STORAGE_PATHS = "msg-store-offline-paths";
focal_class.type: String
focal_class.var_name: MSG_OFFLINE_STORAGE_PATHS
focal_class.declarator: MSG_REPO_CLASS_KEY = "msg-repo-class"
focal_class.modifier: private static final
focal_class.original_string: private static final String MSG_REPO_CLASS_KEY = "msg-repo-class";
focal_class.type: String
focal_class.var_name: MSG_REPO_CLASS_KEY
focal_class.declarator: MSG_PUBSUB_JID = "msg-pubsub-jid"
focal_class.modifier: private static final
focal_class.original_string: private static final String MSG_PUBSUB_JID = "msg-pubsub-jid";
focal_class.type: String
focal_class.var_name: MSG_PUBSUB_JID
focal_class.declarator: MSG_PUBSUB_NODE = "msg-pubsub-node"
focal_class.modifier: private static final
focal_class.original_string: private static final String MSG_PUBSUB_NODE = "msg-pubsub-node";
focal_class.type: String
focal_class.var_name: MSG_PUBSUB_NODE
focal_class.declarator: MSG_PUBSUB_PUBLISHER = "msg-pubsub-publisher"
focal_class.modifier: private static final
focal_class.original_string: private static final String MSG_PUBSUB_PUBLISHER = "msg-pubsub-publisher";
focal_class.type: String
focal_class.var_name: MSG_PUBSUB_PUBLISHER
focal_class.declarator: PUBSUB_NODE_PATH = { Message.ELEM_NAME, "event", "items" }
focal_class.modifier: public static final
focal_class.original_string: public static final String[] PUBSUB_NODE_PATH = { Message.ELEM_NAME, "event", "items" };
focal_class.type: String[]
focal_class.var_name: PUBSUB_NODE_PATH
focal_class.declarator: PUBSUB_NODE_KEY = "node"
focal_class.modifier: public static final
focal_class.original_string: public static final String PUBSUB_NODE_KEY = "node";
focal_class.type: String
focal_class.var_name: PUBSUB_NODE_KEY
focal_class.declarator: formatter
focal_class.modifier: private final
focal_class.original_string: private final SimpleDateFormat formatter;
focal_class.type: SimpleDateFormat
focal_class.var_name: formatter
focal_class.declarator: msgRepoCls = null
focal_class.modifier: private
focal_class.original_string: private String msgRepoCls = null;
focal_class.type: String
focal_class.var_name: msgRepoCls
focal_class.declarator: message = new Message()
focal_class.modifier: private
focal_class.original_string: private Message message = new Message();
focal_class.type: Message
focal_class.var_name: message
focal_class.declarator: pubSubJID
focal_class.modifier: private
focal_class.original_string: private String pubSubJID;
focal_class.type: String
focal_class.var_name: pubSubJID
focal_class.declarator: pubSubNode
focal_class.modifier: private
focal_class.original_string: private String pubSubNode;
focal_class.type: String
focal_class.var_name: pubSubNode
focal_class.declarator: defaultPublisher
focal_class.modifier: private
focal_class.original_string: private String defaultPublisher;
focal_class.type: String
focal_class.var_name: defaultPublisher
focal_class.declarator: offlineStorageMatchers = new ElementMatcher[0]
focal_class.modifier: private
focal_class.original_string: private ElementMatcher[] offlineStorageMatchers = new ElementMatcher[0];
focal_class.type: ElementMatcher[]
focal_class.var_name: offlineStorageMatchers
focal_class.file: tigase-server 7.1.0/src/main/java/tigase/xmpp/impl/OfflineMessages.java
focal_class.identifier: OfflineMessages
focal_class.interfaces: implements XMPPPostprocessorIfc, XMPPProcessorIfc
focal_class.class_method_signature: OfflineMessages.id()
focal_class.full_signature: @Override public String id()
focal_class.identifier: id
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String id()
focal_class.class_method_signature: OfflineMessages.init(Map<String, Object> settings)
focal_class.full_signature: @Override public void init(Map<String, Object> settings)
focal_class.identifier: init
focal_class.modifiers: @Override public
focal_class.parameters: (Map<String, Object> settings)
focal_class.return: void
focal_class.signature: void init(Map<String, Object> settings)
focal_class.class_method_signature: OfflineMessages.postProcess( final Packet packet, final XMPPResourceConnection conn,
  													 final NonAuthUserRepository repo, final Queue<Packet> queue,
  													 Map<String, Object> settings )
focal_class.full_signature: @Override public void postProcess( final Packet packet, final XMPPResourceConnection conn,
  													 final NonAuthUserRepository repo, final Queue<Packet> queue,
  													 Map<String, Object> settings )
focal_class.identifier: postProcess
focal_class.modifiers: @Override public
focal_class.parameters: ( final Packet packet, final XMPPResourceConnection conn,
  													 final NonAuthUserRepository repo, final Queue<Packet> queue,
  													 Map<String, Object> settings )
focal_class.return: void
focal_class.signature: void postProcess( final Packet packet, final XMPPResourceConnection conn,
  													 final NonAuthUserRepository repo, final Queue<Packet> queue,
  													 Map<String, Object> settings )
focal_class.class_method_signature: OfflineMessages.process( final Packet packet, final XMPPResourceConnection conn,
  											 final NonAuthUserRepository repo, final Queue<Packet> results,
  											 final Map<String, Object> settings )
focal_class.full_signature: @Override public void process( final Packet packet, final XMPPResourceConnection conn,
  											 final NonAuthUserRepository repo, final Queue<Packet> results,
  											 final Map<String, Object> settings )
focal_class.identifier: process
focal_class.modifiers: @Override public
focal_class.parameters: ( final Packet packet, final XMPPResourceConnection conn,
  											 final NonAuthUserRepository repo, final Queue<Packet> results,
  											 final Map<String, Object> settings )
focal_class.return: void
focal_class.signature: void process( final Packet packet, final XMPPResourceConnection conn,
  											 final NonAuthUserRepository repo, final Queue<Packet> results,
  											 final Map<String, Object> settings )
focal_class.class_method_signature: OfflineMessages.processIq(Packet packet, XMPPResourceConnection conn, NonAuthUserRepository repo, Queue<Packet> results)
focal_class.full_signature: public void processIq(Packet packet, XMPPResourceConnection conn, NonAuthUserRepository repo, Queue<Packet> results)
focal_class.identifier: processIq
focal_class.modifiers: public
focal_class.parameters: (Packet packet, XMPPResourceConnection conn, NonAuthUserRepository repo, Queue<Packet> results)
focal_class.return: void
focal_class.signature: void processIq(Packet packet, XMPPResourceConnection conn, NonAuthUserRepository repo, Queue<Packet> results)
focal_class.class_method_signature: OfflineMessages.restorePacketForOffLineUser( XMPPResourceConnection conn,
  																										MsgRepositoryIfc repo )
focal_class.full_signature: public Queue<Packet> restorePacketForOffLineUser( XMPPResourceConnection conn,
  																										MsgRepositoryIfc repo )
focal_class.identifier: restorePacketForOffLineUser
focal_class.modifiers: public
focal_class.parameters: ( XMPPResourceConnection conn,
  																										MsgRepositoryIfc repo )
focal_class.return: Queue<Packet>
focal_class.signature: Queue<Packet> restorePacketForOffLineUser( XMPPResourceConnection conn,
  																										MsgRepositoryIfc repo )
focal_class.class_method_signature: OfflineMessages.savePacketForOffLineUser( Packet pac, MsgRepositoryIfc repo, NonAuthUserRepository userRepo)
focal_class.full_signature: public Authorization savePacketForOffLineUser( Packet pac, MsgRepositoryIfc repo, NonAuthUserRepository userRepo)
focal_class.identifier: savePacketForOffLineUser
focal_class.modifiers: public
focal_class.parameters: ( Packet pac, MsgRepositoryIfc repo, NonAuthUserRepository userRepo)
focal_class.return: Authorization
focal_class.signature: Authorization savePacketForOffLineUser( Packet pac, MsgRepositoryIfc repo, NonAuthUserRepository userRepo)
focal_class.class_method_signature: OfflineMessages.supDiscoFeatures( final XMPPResourceConnection session )
focal_class.full_signature: @Override public Element[] supDiscoFeatures( final XMPPResourceConnection session )
focal_class.identifier: supDiscoFeatures
focal_class.modifiers: @Override public
focal_class.parameters: ( final XMPPResourceConnection session )
focal_class.return: Element[]
focal_class.signature: Element[] supDiscoFeatures( final XMPPResourceConnection session )
focal_class.class_method_signature: OfflineMessages.supElementNamePaths()
focal_class.full_signature: @Override public String[][] supElementNamePaths()
focal_class.identifier: supElementNamePaths
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String[][]
focal_class.signature: String[][] supElementNamePaths()
focal_class.class_method_signature: OfflineMessages.supNamespaces()
focal_class.full_signature: @Override public String[] supNamespaces()
focal_class.identifier: supNamespaces
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String[]
focal_class.signature: String[] supNamespaces()
focal_class.class_method_signature: OfflineMessages.getMsgRepoImpl( NonAuthUserRepository repo,
  																						 XMPPResourceConnection conn )
focal_class.full_signature: protected MsgRepositoryIfc getMsgRepoImpl( NonAuthUserRepository repo,
  																						 XMPPResourceConnection conn )
focal_class.identifier: getMsgRepoImpl
focal_class.modifiers: protected
focal_class.parameters: ( NonAuthUserRepository repo,
  																						 XMPPResourceConnection conn )
focal_class.return: MsgRepositoryIfc
focal_class.signature: MsgRepositoryIfc getMsgRepoImpl( NonAuthUserRepository repo,
  																						 XMPPResourceConnection conn )
focal_class.class_method_signature: OfflineMessages.isAllowedForOfflineStorage(Packet pac)
focal_class.full_signature: protected boolean isAllowedForOfflineStorage(Packet pac)
focal_class.identifier: isAllowedForOfflineStorage
focal_class.modifiers: protected
focal_class.parameters: (Packet pac)
focal_class.return: boolean
focal_class.signature: boolean isAllowedForOfflineStorage(Packet pac)
focal_class.class_method_signature: OfflineMessages.isAllowedForOfflineStorageDefaults(Packet pac)
focal_class.full_signature: protected boolean isAllowedForOfflineStorageDefaults(Packet pac)
focal_class.identifier: isAllowedForOfflineStorageDefaults
focal_class.modifiers: protected
focal_class.parameters: (Packet pac)
focal_class.return: boolean
focal_class.signature: boolean isAllowedForOfflineStorageDefaults(Packet pac)
focal_class.class_method_signature: OfflineMessages.loadOfflineMessages( Packet packet, XMPPResourceConnection conn )
focal_class.full_signature: protected boolean loadOfflineMessages( Packet packet, XMPPResourceConnection conn )
focal_class.identifier: loadOfflineMessages
focal_class.modifiers: protected
focal_class.parameters: ( Packet packet, XMPPResourceConnection conn )
focal_class.return: boolean
focal_class.signature: boolean loadOfflineMessages( Packet packet, XMPPResourceConnection conn )
focal_class.class_method_signature: OfflineMessages.publishInPubSub(final Packet packet, final XMPPResourceConnection conn, final Queue<Packet> queue,
  			Map<String, Object> settings)
focal_class.full_signature: public void publishInPubSub(final Packet packet, final XMPPResourceConnection conn, final Queue<Packet> queue,
  			Map<String, Object> settings)
focal_class.identifier: publishInPubSub
focal_class.modifiers: public
focal_class.parameters: (final Packet packet, final XMPPResourceConnection conn, final Queue<Packet> queue,
  			Map<String, Object> settings)
focal_class.return: void
focal_class.signature: void publishInPubSub(final Packet packet, final XMPPResourceConnection conn, final Queue<Packet> queue,
  			Map<String, Object> settings)
focal_class.superclass: extends XMPPProcessor
focal_method.body: protected boolean loadOfflineMessages( Packet packet, XMPPResourceConnection conn ) {
  
  		// If the user session is null or the user is anonymous just
  		// ignore it.
  		if ( ( conn == null ) || conn.isAnonymous() ){
  			return false;
  		}    // end of if (session == null)
  
  		// Try to restore the offline messages only once for the user session
  		if ( conn.getSessionData( ID ) != null ){
  			return false;
  		}
  		
  		// make sure this is broadcast presence as only in this case we should sent offline messages
  		if (packet.getStanzaTo() != null)
  			return false;		
  
  		// if we are using XEP-0013: Flexible offline messages retrieval then we skip loading
  		if ( conn.getCommonSessionData(FlexibleOfflineMessageRetrieval.FLEXIBLE_OFFLINE_XMLNS) != null ){
  			return false;
  		}
  
  		StanzaType type = packet.getType();
  
  		if ( ( type == null ) || ( type == StanzaType.available ) ){
  
  			// Should we send off-line messages now?
  			// Let's try to do it here and maybe later I find better place.
  			String priority_str = packet.getElemCDataStaticStr( tigase.server.Presence.PRESENCE_PRIORITY_PATH );
  			int priority = 0;
  
  			if ( priority_str != null ){
  				try {
  					priority = Integer.decode( priority_str );
  				} catch ( NumberFormatException e ) {
  					priority = 0;
  				}    // end of try-catch
  			}      // end of if (priority != null)
  			if ( priority >= 0 ){
  				conn.putSessionData( ID, ID );
  
  				return true;
  			}      // end of if (priority >= 0)
  		}        // end of if (type == null || type == StanzaType.available)
  
  		return false;
  	}
focal_method.class_method_signature: OfflineMessages.loadOfflineMessages( Packet packet, XMPPResourceConnection conn )
focal_method.full_signature: protected boolean loadOfflineMessages( Packet packet, XMPPResourceConnection conn )
focal_method.identifier: loadOfflineMessages
focal_method.invocations: isAnonymous getSessionData getStanzaTo getCommonSessionData getType getElemCDataStaticStr decode putSessionData
focal_method.modifiers: protected
focal_method.parameters: ( Packet packet, XMPPResourceConnection conn )
focal_method.return: boolean
focal_method.signature: boolean loadOfflineMessages( Packet packet, XMPPResourceConnection conn )