diff --git a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/event/IRosterChangeEvent.java b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/event/IRosterChangeEvent.java index 782268a151..5fef24d866 100644 --- a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/event/IRosterChangeEvent.java +++ b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/event/IRosterChangeEvent.java @@ -19,6 +19,8 @@ **/ package com.raytheon.uf.viz.collaboration.comm.identity.event; +import com.raytheon.uf.viz.collaboration.comm.identity.roster.IRosterEntry; + /** * TODO Add Description * @@ -37,18 +39,17 @@ package com.raytheon.uf.viz.collaboration.comm.identity.event; */ public interface IRosterChangeEvent { - - public enum ChangeType { ADD, DELETE, MODIFY, }; /** - * - * @return + * Get the event type. + * @return The event type. */ - ChangeType getType(); - - - - + RosterChangeType getType(); + /** + * Get the changed entry + * @return The changed entry. + */ + IRosterEntry getEntry(); } diff --git a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/event/IRosterEventSubscriber.java b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/event/IRosterEventSubscriber.java new file mode 100644 index 0000000000..6ec508b62c --- /dev/null +++ b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/event/IRosterEventSubscriber.java @@ -0,0 +1,41 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.uf.viz.collaboration.comm.identity.event; + +/** + * TODO Add Description + * + *
+ * + * SOFTWARE HISTORY + * + * Date Ticket# Engineer Description + * ------------ ---------- ----------- -------------------------- + * Apr 11, 2012 jkorman Initial creation + * + *+ * + * @author jkorman + * @version 1.0 + */ + +public interface IRosterEventSubscriber { + // Tag interface. +} diff --git a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/event/RosterChangeType.java b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/event/RosterChangeType.java new file mode 100644 index 0000000000..9a70f8528c --- /dev/null +++ b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/identity/event/RosterChangeType.java @@ -0,0 +1,41 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.uf.viz.collaboration.comm.identity.event; + +/** + * TODO Add Description + * + *
+ * + * SOFTWARE HISTORY + * + * Date Ticket# Engineer Description + * ------------ ---------- ----------- -------------------------- + * Apr 11, 2012 jkorman Initial creation + * + *+ * + * @author jkorman + * @version 1.0 + */ + +public enum RosterChangeType { + ADD, DELETE, MODIFY, PRESENCE +} diff --git a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/event/RosterChangeEvent.java b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/event/RosterChangeEvent.java new file mode 100644 index 0000000000..61ffb3925a --- /dev/null +++ b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/event/RosterChangeEvent.java @@ -0,0 +1,81 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.uf.viz.collaboration.comm.provider.event; + +import com.raytheon.uf.viz.collaboration.comm.identity.event.IRosterChangeEvent; +import com.raytheon.uf.viz.collaboration.comm.identity.event.RosterChangeType; +import com.raytheon.uf.viz.collaboration.comm.identity.roster.IRosterEntry; + +/** + * TODO Add Description + * + *
+ * + * SOFTWARE HISTORY + * + * Date Ticket# Engineer Description + * ------------ ---------- ----------- -------------------------- + * Apr 11, 2012 jkorman Initial creation + * + *+ * + * @author jkorman + * @version 1.0 + */ + +public class RosterChangeEvent implements IRosterChangeEvent { + + private final RosterChangeType type; + + private final IRosterEntry entry; + + /** + * Create an instance of this event using the given type and + * entry. + * @param type The event type. + * @param entry The changed entry. + */ + public RosterChangeEvent(RosterChangeType type, IRosterEntry entry) { + this.type = type; + this.entry = entry; + } + + /** + * Get the event type. + * + * @return The event type. + * @see com.raytheon.uf.viz.collaboration.comm.identity.event.IRosterChangeEvent#getType() + */ + @Override + public RosterChangeType getType() { + return type; + } + + /** + * Get the changed entry + * @return The changed entry. + * @see com.raytheon.uf.viz.collaboration.comm.identity.event.IRosterChangeEvent#getEntry() + */ + @Override + public IRosterEntry getEntry() { + return entry; + } + +} diff --git a/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/session/RosterEventHandler.java b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/session/RosterEventHandler.java new file mode 100644 index 0000000000..d6035f2012 --- /dev/null +++ b/cave/com.raytheon.uf.viz.collaboration/src/com/raytheon/uf/viz/collaboration/comm/provider/session/RosterEventHandler.java @@ -0,0 +1,91 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.uf.viz.collaboration.comm.provider.session; + +import java.util.Collection; + +import com.google.common.eventbus.Subscribe; +import com.raytheon.uf.viz.collaboration.comm.identity.IPresence; +import com.raytheon.uf.viz.collaboration.comm.identity.event.IRosterChangeEvent; +import com.raytheon.uf.viz.collaboration.comm.identity.roster.IRosterEntry; +import com.raytheon.uf.viz.collaboration.comm.identity.roster.IRosterGroup; + +/** + * TODO Add Description + * + *
+ * + * SOFTWARE HISTORY + * + * Date Ticket# Engineer Description + * ------------ ---------- ----------- -------------------------- + * Apr 11, 2012 jkorman Initial creation + * + *+ * + * @author jkorman + * @version 1.0 + */ + +public class RosterEventHandler { + + + @Subscribe + public void eventHandler(IRosterChangeEvent event) { + + StringBuilder sb = new StringBuilder("-------------------------------------------------------\n"); + sb.append("RosterEventHandler.eventHandler("); + switch(event.getType()) { + + case ADD : { + sb.append("ADD)"); + break; + } + case MODIFY : { + sb.append("MODIFY)"); + break; + } + case DELETE : { + sb.append("DELETE)"); + break; + } + case PRESENCE : { + sb.append("PRESENCE)"); + break; + } + } + System.out.println(sb.toString()); + printRosterEntry(event.getEntry()); + } + + private void printRosterEntry(IRosterEntry entry) { + // System.out.println("handleRosterEntryAdd " + System.currentTimeMillis()); + System.out.println(" user : " + entry.getUser().getFQName()); + Collection