/*
 * Copyright 2004-2014 ICEsoft Technologies Canada Corp.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the
 * License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an "AS
 * IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */

package org.icepush;

import java.util.Map;
import java.util.Set;

public interface PushGroupManager {
    void addMember(String groupName, String pushID);

    PushID getPushID(String pushIDString);

    void push(String groupName);

    void push(String groupName, PushConfiguration config);

    void park(String pushID, NotifyBackURI notifyBackURI);
    
    void pruneParkedIDs(NotifyBackURI notifyBackURI, Set<String> listenedPushIDSet);

    Set<String> getPendingNotificationSet();

    void clearPendingNotification(String pushID);

    void clearPendingNotifications(Set<String> pushIDSet);

    void addNotificationReceiver(NotificationBroadcaster.Receiver receiver);

    void deleteNotificationReceiver(NotificationBroadcaster.Receiver observer);

    void removeMember(String groupName, String pushID);

    void addPushGroupListener(PushGroupListener listener);

    void removePushGroupListener(PushGroupListener listener);

    Map<String, String[]> getGroupMap();

    void shutdown();

    void recordListen(Set<String> pushIDSet, long sequenceNumber);

    void startConfirmationTimeout(Set<String> pushIDSet);

    void cancelConfirmationTimeout(Set<String> pushIDSet);

    void startExpiryTimeout(Set<String> pushIDSet, NotifyBackURI notifyBackURI);

    void cancelExpiryTimeout(Set<String> pushIDSet);

    void addBlockingConnectionServer(BlockingConnectionServer server);

    void removeBlockingConnectionServer(BlockingConnectionServer server);

    void backOff(String browserID, long delay);

    boolean setNotifyBackURI(Set<String> pushIDSet, NotifyBackURI notifyBackURI, boolean broadcast);

    NotifyBackURI getNotifyBackURI(String pushID);

}
