@Override @Cacheable.FlushBefore public boolean add(@NotNull final URN user, @NotNull final Domain domain) throws IOException { final ConcurrentMap<String, AttributeValue> attrs = new ConcurrentHashMap<String, AttributeValue>(0); attrs.put(DefaultDynamo.USER, new AttributeValue(user.toString())); attrs.put(DefaultDynamo.NAME, new AttributeValue(domain.name())); attrs.put(DefaultDynamo.KEY, new AttributeValue(domain.key())); attrs.put(DefaultDynamo.SECRET, new AttributeValue(domain.secret())); attrs.put(DefaultDynamo.REGION, new AttributeValue(domain.region())); attrs.put(DefaultDynamo.SYSLOG, new AttributeValue(domain.syslog())); attrs.put(DefaultDynamo.BUCKET, new AttributeValue(domain.bucket())); this.region.table(this.table).put(attrs); return true; }
@Override @Cacheable.FlushBefore public Iterable<Message> search(final String term) throws IOException { return Iterables.transform( this.origin.search(term), new Function<Message, Message>() { @Override public Message apply(final Message message) { return new CdMessage(message); } } ); } }
@Override @Cacheable.FlushBefore public boolean remove(@NotNull final Domain domain) { final Iterator<Item> items = this.region.table(this.table).frame() .where(DefaultDynamo.NAME, domain.name()) .through(new ScanValve().withLimit(Tv.MILLION)) .iterator(); boolean removed = false; while (items.hasNext()) { items.next(); items.remove(); removed = true; } return removed; }
@Override @Cacheable.FlushBefore public Alias add(final String name) throws IOException { return this.origin.add(name); }
@Override @Cacheable.FlushBefore public void subscribe(final boolean subs) throws IOException { this.origin.subscribe(subs); }
@Override @Cacheable.FlushBefore public void invite(final String friend) throws IOException { this.origin.invite(friend); }
@Override @Cacheable.FlushBefore public long start() throws IOException { return this.origin.start(); }
@Override @Cacheable.FlushBefore public void kick(final String friend) throws IOException { this.origin.kick(friend); }
@Override @Cacheable.FlushBefore public void delete(final String name) throws IOException { this.origin.delete(name); }
@Override @Cacheable.FlushBefore public void photo(final URI uri) throws IOException { this.origin.photo(uri); }
@Override @Cacheable.FlushBefore public void rename(final String text) throws IOException { this.origin.rename(text); }
@Override @Cacheable.FlushBefore public void create(final String name) throws IOException { this.origin.create(name); }
@Override @Cacheable.FlushBefore public Iterable<Message> iterate() throws IOException { return Iterables.transform( this.origin.iterate(), new Function<Message, Message>() { @Override public Message apply(final Message message) { return new CdMessage(message); } } ); }
@Override @Cacheable.FlushBefore public void email(final String email) throws IOException { this.origin.email(email); }