public class MockDatabase extends TemporaryDatabasePostgreSQL implements EventWriter
TemporaryDatabasePostgreSQL
class. For instance, it can be populated from a MockNetwork
.MAX_DATABASE_DROP_ATTEMPTS
ADMIN_PASSWORD_PROPERTY, ADMIN_USER_PROPERTY, DEFAULT_ADMIN_PASSWORD, DEFAULT_ADMIN_USER, DEFAULT_DRIVER, DEFAULT_URL, DRIVER_PROPERTY, URL_PROPERTY
Constructor and Description |
---|
MockDatabase() |
MockDatabase(boolean createNow) |
MockDatabase(String dbName) |
MockDatabase(String name,
boolean createNow) |
countRows, create, drop, dumpThreads, failIfUnitTest, findIpLikeLibrary, getAdminDataSource, getAdminXADataSource, getClassName, getConnection, getConnection, getCreateSqlLocation, getDatabaseName, getDataSource, getDriver, getJdbcTemplate, getLoginTimeout, getLogWriter, getMethodName, getNextId, getNextSequenceValStatement, getParentLogger, getStoredProcDirectory, getTestDatabase, getTestDetails, getUrl, getXAConnection, getXAConnection, getXADataSource, isSetupIpLike, isWrapperFor, setAdminDataSource, setClassName, setDataSource, setJdbcTemplate, setLoginTimeout, setLogWriter, setMethodName, setPopulateSchema, setSetupIpLike, setTestDetails, setupBlame, setupDatabase, toString, unwrap, update
public void populate(MockNetwork network)
public void writeNode(MockNode node)
public void writeInterface(MockInterface iface)
public Integer writeSnmpInterface(MockInterface iface)
public void writeService(MockService svc)
public void writePathOutage(MockPathOutage out)
public String getNextOutageIdStatement()
public Integer getNextOutageId()
public String getNextEventIdStatement()
public Integer getNextEventId()
public String getNextServiceIdStatement()
public Integer getNextServiceId()
public String getNextSnmpInterfaceIdStatement()
public Integer getNextSnmpInterfaceId()
public String getServiceName(int serviceId)
public int countOutagesForService(MockService svc)
public int countOpenOutagesForService(MockService svc)
public int countOutagesForService(MockService svc, String criteria)
public void createOutage(MockService svc, Event svcLostEvent)
public void createOutage(MockService svc, int eventId, Timestamp time)
public void resolveOutage(MockService svc, Event svcRegainEvent)
public void resolveOutage(MockService svc, int eventId, Timestamp timestamp)
public void writeEvent(Event e)
writeEvent
in interface EventWriter
e
- public void setServiceStatus(MockService svc, char newStatus)
public char getServiceStatus(MockService svc)
public void setInterfaceStatus(MockInterface iface, char newStatus)
public char getInterfaceStatus(MockInterface iface)
public int countOutages()
public int countOpenOutages()
public int countOutages(String criteria)
public int countOutagesForInterface(MockInterface iface)
public int countOpenOutagesForInterface(MockInterface iface)
public int countOutagesForInterface(MockInterface iface, String criteria)
public boolean hasOpenOutage(MockService svc)
public Collection<Outage> getOutages()
public Collection<Outage> getOutages(String criteria, Object... values)
public Collection<Outage> getOpenOutages(MockService svc)
public Collection<Outage> getOutages(MockService svc)
public Collection<Outage> getClosedOutages(MockService svc)
public void reparentInterface(String ipAddr, int oldNode, int newNode)
ipAddr
- nodeId
- nodeId2
- public String getNextNotifIdSql()
public void acknowledgeNoticesForEvent(Event e)
e
- public Collection<Integer> findNoticesForEvent(Event event)
event
- public String getNextUserNotifIdSql()
Copyright © 2018. All rights reserved.