Class: Vines::Storage::Null

Inherits:
Vines::Storage show all
Defined in:
lib/vines/storage/null.rb

Overview

A storage implementation that does not persist data to any form of storage. When looking up the storage object for a domain, it’s easier to treat a missing domain with a Null storage than checking for nil.

For example, presence subscription stanzas sent to a pubsub subdomain have no storage. Rather than checking for nil storage or pubsub addresses, it’s easier to treat stanzas to pubsub domains as Null storage that never finds or saves users and their rosters.

Instance Method Summary collapse

Methods inherited from Vines::Storage

#authenticate, defer, fiber, #find_avatar_by_jid, from_name, register

Methods included from Log

#log, set_log_file

Instance Method Details

#destroy_message(id) ⇒ Object



46
47
48
# File 'lib/vines/storage/null.rb', line 46

def destroy_message(id)
  # do nothing
end

#find_fragment(jid, node) ⇒ Object



30
31
32
# File 'lib/vines/storage/null.rb', line 30

def find_fragment(jid, node)
  nil
end

#find_messages(jid) ⇒ Object



38
39
40
# File 'lib/vines/storage/null.rb', line 38

def find_messages(jid)
  {}
end

#find_user(jid) ⇒ Object



14
15
16
# File 'lib/vines/storage/null.rb', line 14

def find_user(jid)
  nil
end

#find_vcard(jid) ⇒ Object



22
23
24
# File 'lib/vines/storage/null.rb', line 22

def find_vcard(jid)
  nil
end

#save_fragment(jid, node) ⇒ Object



34
35
36
# File 'lib/vines/storage/null.rb', line 34

def save_fragment(jid, node)
  # do nothing
end

#save_message(from, to, message) ⇒ Object



42
43
44
# File 'lib/vines/storage/null.rb', line 42

def save_message(from, to, message)
  # do nothing
end

#save_user(user) ⇒ Object



18
19
20
# File 'lib/vines/storage/null.rb', line 18

def save_user(user)
  # do nothing
end

#save_vcard(jid, card) ⇒ Object



26
27
28
# File 'lib/vines/storage/null.rb', line 26

def save_vcard(jid, card)
  # do nothing
end