public void subcribe(long userid, long entityid, SubscriptionProvider service) throws SystemException { if (this == ALL) { for (DebateActivityKeys key:values()) { if (key == ALL) continue; else key.subcribe(userid,entityid,service); } } service.createSubscription("debates", userid, entityid,ordinal()); }
public boolean isSubscribed(long userid, long entityid, SubscriptionProvider service) throws SystemException { if (this == ALL) { for (DebateActivityKeys key:values()) { if (key == ALL) continue; if (!key.isSubscribed(userid,entityid,service)) return false; } } return service.isSubscribed("debates", userid, entityid,ordinal()); }
public static DebateActivityKeys fromId(int id) { return DebateActivityKeys.values()[id]; }