Search in sources :

Example 6 with ServiceDescriptor

use of org.opendaylight.infrautils.diagstatus.ServiceDescriptor in project infrautils by opendaylight.

the class DiagStatusIT method testDiagStatusPushModel.

@Test
public void testDiagStatusPushModel() {
    String testService1 = "testService";
    diagStatusService.register(testService1);
    // Verify if "testService" got registered with STARTING state.
    ServiceDescriptor serviceDescriptor = diagStatusService.getServiceDescriptor(testService1);
    Assert.assertEquals(serviceDescriptor.getServiceState(), ServiceState.STARTING);
    // Verify if "testService" status is updated as OPERATIONAL.
    diagStatusService.report(new ServiceDescriptor(testService1, ServiceState.OPERATIONAL, "service is UP"));
    serviceDescriptor = diagStatusService.getServiceDescriptor(testService1);
    Assert.assertEquals(serviceDescriptor.getServiceState(), ServiceState.OPERATIONAL);
}
Also used : ServiceDescriptor(org.opendaylight.infrautils.diagstatus.ServiceDescriptor) AbstractIntegrationTest(org.opendaylight.infrautils.itestutils.AbstractIntegrationTest) Test(org.junit.Test)

Example 7 with ServiceDescriptor

use of org.opendaylight.infrautils.diagstatus.ServiceDescriptor in project genius by opendaylight.

the class ItmDiagStatusProvider method close.

@PreDestroy
public void close() {
    serviceDescriptor = new ServiceDescriptor(ITMConstants.ITM_SERVICE_NAME, ServiceState.UNREGISTERED, "Service Closed");
    diagStatusService.report(serviceDescriptor);
}
Also used : ServiceDescriptor(org.opendaylight.infrautils.diagstatus.ServiceDescriptor) PreDestroy(javax.annotation.PreDestroy)

Example 8 with ServiceDescriptor

use of org.opendaylight.infrautils.diagstatus.ServiceDescriptor in project genius by opendaylight.

the class IfmDiagStatusProvider method close.

@PreDestroy
public void close() {
    serviceDescriptor = new ServiceDescriptor(IfmConstants.INTERFACE_SERVICE_NAME, ServiceState.UNREGISTERED, "Service Closed");
    diagStatusService.report(serviceDescriptor);
}
Also used : ServiceDescriptor(org.opendaylight.infrautils.diagstatus.ServiceDescriptor) PreDestroy(javax.annotation.PreDestroy)

Example 9 with ServiceDescriptor

use of org.opendaylight.infrautils.diagstatus.ServiceDescriptor in project genius by opendaylight.

the class DatastoreServiceStatusProvider method close.

@PreDestroy
public void close() {
    serviceDescriptor = new ServiceDescriptor(DATASTORE_SERVICE_NAME, ServiceState.UNREGISTERED, "Service Closed");
    diagStatusService.report(serviceDescriptor);
}
Also used : ServiceDescriptor(org.opendaylight.infrautils.diagstatus.ServiceDescriptor) PreDestroy(javax.annotation.PreDestroy)

Example 10 with ServiceDescriptor

use of org.opendaylight.infrautils.diagstatus.ServiceDescriptor in project netvirt by opendaylight.

the class ElanDiagStatusProvider method close.

@PreDestroy
public void close() {
    serviceDescriptor = new ServiceDescriptor(ElanConstants.ELAN_SERVICE_NAME, ServiceState.UNREGISTERED, "Service Closed");
    diagStatusService.report(serviceDescriptor);
}
Also used : ServiceDescriptor(org.opendaylight.infrautils.diagstatus.ServiceDescriptor) PreDestroy(javax.annotation.PreDestroy)

Aggregations

ServiceDescriptor (org.opendaylight.infrautils.diagstatus.ServiceDescriptor)14 PreDestroy (javax.annotation.PreDestroy)4 Test (org.junit.Test)2 ServiceState (org.opendaylight.infrautils.diagstatus.ServiceState)2 JsonWriter (com.google.gson.stream.JsonWriter)1 IOException (java.io.IOException)1 StringWriter (java.io.StringWriter)1 Date (java.util.Date)1 ServiceStatusProvider (org.opendaylight.infrautils.diagstatus.ServiceStatusProvider)1 AbstractIntegrationTest (org.opendaylight.infrautils.itestutils.AbstractIntegrationTest)1