package com.onaro.sanscreen.client.view.changes; import com.onaro.commons.util.OnaroArrays; import com.onaro.sanscreen.types.ChangeType; import static com.onaro.sanscreen.types.ChangeType.*; import java.util.Set; /** * A filter for device configuration changes. */ public class TypeFilterDeviceConfiguration implements TypeFilter { /** * The set of types that defines up/down changes. */ public final static Set ACCEPTED_CHANGE_TYPES = OnaroArrays.asSet( DEVICE_UP, DEVICE_DOWN, DEVICE_CREATED, DEVICE_ATTRIBUTE_CHANGE, DEVICE_CONFIGURATION_CHANGE, APPLICATION_ADDED, APPLICATION_REMOVED, HOST_ADDED_TO_APPLICATION, HOST_REMOVED_FROM_APPLICATION, BUSINESS_ENTITY_ADDED, BUSINESS_ENTITY_REMOVED, TOO_MANY_CHANGES); //TODO: look into adding other *_APPLICATION types /** * Tests if a change-group is for a device configuration change. * @param changeGroup the change-group * @return true if this change is a device configuration */ public boolean shouldBeDisplayed(ChangeGroup changeGroup) { return ACCEPTED_CHANGE_TYPES.contains(changeGroup.getType()); } }