Skip to content

Commit

Permalink
Adds default impl for GatewayListener methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
damencho committed Sep 7, 2018
1 parent c4df040 commit 3779ce0
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 49 deletions.
12 changes: 8 additions & 4 deletions src/main/java/org/jitsi/jigasi/GatewayListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,26 @@ public interface GatewayListener
* Called when new session is added to the list of active sessions.
* @param session the session that was added.
*/
void onSessionAdded(AbstractGatewaySession session);
default void onSessionAdded(AbstractGatewaySession session)
{}

/**
* Called when a session is removed from the list of active sessions.
* @param session the session that was removed.
*/
void onSessionRemoved(AbstractGatewaySession session);
default void onSessionRemoved(AbstractGatewaySession session)
{}

/**
* Called when a session failed to establish.
* @param session the session that failed.
*/
void onSessionFailed(AbstractGatewaySession session);
default void onSessionFailed(AbstractGatewaySession session)
{}

/**
* Called when the gateway is ready to create new sessions.
*/
void onReady();
default void onReady()
{}
}
12 changes: 0 additions & 12 deletions src/main/java/org/jitsi/jigasi/health/Health.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,6 @@ public static void start()
final SipGateway finalSipGw = sipGateway;
sipGateway.addGatewayListener(new GatewayListener()
{
@Override
public void onSessionAdded(AbstractGatewaySession session)
{}

@Override
public void onSessionRemoved(AbstractGatewaySession session)
{}

@Override
public void onSessionFailed(AbstractGatewaySession session)
{}

@Override
public void onReady()
{
Expand Down
12 changes: 0 additions & 12 deletions src/main/java/org/jitsi/jigasi/rest/HandlerImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,6 @@ private void doGetStatisticsJSON(
}
}

@Override
public void onSessionAdded(AbstractGatewaySession session)
{}

/**
* When a session ends we add all the cumulative statistics.
*
Expand All @@ -293,14 +289,6 @@ public void onSessionRemoved(AbstractGatewaySession session)
- session.getCallContext().getTimestamp()));
}

@Override
public void onSessionFailed(AbstractGatewaySession session)
{}

@Override
public void onReady()
{}

/**
* Gets a JSON representation of the health (status) of a specific
* {@link SipGateway}. The method is synchronized so anything other than
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,14 +340,6 @@ public void onSessionRemoved(AbstractGatewaySession session)
session.removeListener(this);
}

@Override
public void onSessionFailed(AbstractGatewaySession session)
{}

@Override
public void onReady()
{}

/**
* Updates the presence in each {@link ProtocolProviderService} registered
* with OSGi with the current number of conferences and participants.
Expand Down
13 changes: 0 additions & 13 deletions src/test/java/org/jitsi/jigasi/GatewaySessions.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,6 @@ public void onSessionAdded(AbstractGatewaySession session)
}
}

@Override
public void onSessionRemoved(AbstractGatewaySession session)
{}

@Override
public void onSessionFailed(
AbstractGatewaySession session)
{}

@Override
public void onReady()
{}

/**
* Obtain sessions
* @param timeout the time to wait to receive the sessions
Expand Down

0 comments on commit 3779ce0

Please sign in to comment.