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 testRestorePacketForOffLineUser() throws Exception {
  		BareJID userJid = BareJID.bareJIDInstance("user1@example.com");
  		JID res1 = JID.jidInstance(userJid, "res1");
  		XMPPResourceConnection session1 = getSession(JID.jidInstance("c2s@example.com/" + UUID.randomUUID().toString()), res1);
  
  		assertEquals(Arrays.asList(session1), session1.getActiveSessions());
  
  		Element packetEl = new Element("iq", new String[] { "type", "from", "to", "time" },
  				new String[] { "set", "dip1@test.com/res1", userJid.toString(), "1440810935000" });
  		packetEl.addChild(new Element("jingle", new String[] { "action", "sid", "offline", "xmlns" },
  				new String[] { "session-terminate", UUID.randomUUID().toString(), "true", "urn:xmpp:jingle:1" }));
  		Packet packet = Packet.packetInstance(packetEl);
  		msgRepo.storeMessage( packet.getFrom(), packet.getTo(), null, packet.getElement(), null);
  
  		packetEl = new Element("iq", new String[] { "type", "from", "to", "time" },
  				new String[] { "set", "dip1@test.com/res1", userJid.toString(), "1440810972000" });
  		packetEl.addChild(new Element("jingle", new String[] { "action", "sid", "offline", "xmlns" },
  				new String[] { "session-terminate", UUID.randomUUID().toString(), "true", "urn:xmpp:jingle:1" }));
  		packet = Packet.packetInstance(packetEl);
  		msgRepo.storeMessage( packet.getFrom(), packet.getTo(), null, packet.getElement(), null);
  
  		assertTrue("no message stored, while it should be stored", !msgRepo.getStored().isEmpty());
  
  		Queue<Packet> restorePacketForOffLineUser = offlineProcessor.restorePacketForOffLineUser( session1, msgRepo );
  
  		assertEquals("number of restored messages differ!", restorePacketForOffLineUser.size(), 2);
  
  		msgRepo.getStored().clear();
  	}
test_case.class_method_signature: OfflineMessagesTest.testRestorePacketForOffLineUser()
test_case.full_signature: @Test public void testRestorePacketForOffLineUser()
test_case.identifier: testRestorePacketForOffLineUser
test_case.invocations: bareJIDInstance jidInstance getSession jidInstance toString randomUUID assertEquals asList getActiveSessions toString addChild toString randomUUID packetInstance storeMessage getFrom getTo getElement toString addChild toString randomUUID packetInstance storeMessage getFrom getTo getElement assertTrue isEmpty getStored restorePacketForOffLineUser assertEquals size clear getStored
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testRestorePacketForOffLineUser()
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: public Queue<Packet> restorePacketForOffLineUser( XMPPResourceConnection conn,
  																										MsgRepositoryIfc repo )
  			throws UserNotFoundException, NotAuthorizedException {
  		Queue<Element> elems = repo.loadMessagesToJID( conn, true );
  
  		if ( elems != null ){
  			LinkedList<Packet> pacs = new LinkedList<Packet>();
  			Element elem = null;
  
  			while ( ( elem = elems.poll() ) != null ) {
  				try {
  					Packet p = Packet.packetInstance( elem );
  					if (p.getElemName() == Iq.ELEM_NAME) {
  						p.initVars(p.getStanzaFrom(), conn.getJID());
  					}
  					pacs.offer( p );
  				} catch ( TigaseStringprepException ex ) {
  					log.warning( "Packet addressing problem, stringprep failed: " + elem );
  				}
  			}    // end of while (elem = elems.poll() != null)
  			try {
  				Collections.sort( pacs, new StampComparator() );
  			} catch ( NullPointerException e ) {
  				try {
  					log.warning( "Can not sort off line messages: " + pacs + ",\n" + e );
  				} catch ( Exception exc ) {
  					log.log( Level.WARNING, "Can not print log message.", exc );
  				}
  			}
  
  			return pacs;
  		}
  
  		return null;
  	}
focal_method.class_method_signature: OfflineMessages.restorePacketForOffLineUser( XMPPResourceConnection conn,
  																										MsgRepositoryIfc repo )
focal_method.full_signature: public Queue<Packet> restorePacketForOffLineUser( XMPPResourceConnection conn,
  																										MsgRepositoryIfc repo )
focal_method.identifier: restorePacketForOffLineUser
focal_method.invocations: loadMessagesToJID poll packetInstance getElemName initVars getStanzaFrom getJID offer warning sort warning log
focal_method.modifiers: public
focal_method.parameters: ( XMPPResourceConnection conn,
  																										MsgRepositoryIfc repo )
focal_method.return: Queue<Packet>
focal_method.signature: Queue<Packet> restorePacketForOffLineUser( XMPPResourceConnection conn,
  																										MsgRepositoryIfc repo )