Search in sources :

Example 1 with EntityExistsCommand

use of com.cloud.agent.api.manager.EntityExistsCommand in project cloudstack by apache.

the class CommandsTest method testCommandEquals.

@Test
public void testCommandEquals() throws IllegalAccessException, InvocationTargetException, InstantiationException {
    addCommandEqualityGroup(ApplyAclRuleVspCommand.class);
    addCommandEqualityGroup(ImplementVspCommand.class);
    addCommandEqualityGroup(ApplyStaticNatVspCommand.class);
    addCommandEqualityGroup(ShutDownVpcVspCommand.class);
    addCommandEqualityGroup(DeallocateVmVspCommand.class);
    addCommandEqualityGroup(ImplementNetworkVspCommand.class);
    addCommandEqualityGroup(ReserveVmInterfaceVspCommand.class);
    addCommandEqualityGroup(TrashNetworkVspCommand.class);
    addCommandEqualityGroup(SyncDomainCommand.class);
    addCommandEqualityGroup(SyncNuageVspCmsIdCommand.class);
    addCommandEqualityGroup(PingNuageVspCommand.class);
    SupportedApiVersionCommand supportedApiVersionCommandA = new SupportedApiVersionCommand("3.2");
    SupportedApiVersionCommand supportedApiVersionCommandB = new SupportedApiVersionCommand("3.2");
    EntityExistsCommand entityExistsCommandA = new EntityExistsCommand(Command.class, "uuid");
    EntityExistsCommand entityExistsCommandB = new EntityExistsCommand(Command.class, "uuid");
    tester.addEqualityGroup(supportedApiVersionCommandA, supportedApiVersionCommandB).addEqualityGroup(entityExistsCommandA, entityExistsCommandB).testEquals();
}
Also used : SupportedApiVersionCommand(com.cloud.agent.api.manager.SupportedApiVersionCommand) EntityExistsCommand(com.cloud.agent.api.manager.EntityExistsCommand) Test(org.junit.Test)

Example 2 with EntityExistsCommand

use of com.cloud.agent.api.manager.EntityExistsCommand in project cloudstack by apache.

the class CommandsTest method testCommandGsonEquals.

@Test
public void testCommandGsonEquals() throws IllegalAccessException, InvocationTargetException, InstantiationException {
    addCommandGsonEqualityGroup(ApplyAclRuleVspCommand.class);
    addCommandGsonEqualityGroup(ImplementVspCommand.class);
    addCommandGsonEqualityGroup(ApplyStaticNatVspCommand.class);
    addCommandGsonEqualityGroup(ShutDownVpcVspCommand.class);
    addCommandGsonEqualityGroup(DeallocateVmVspCommand.class);
    addCommandGsonEqualityGroup(ImplementNetworkVspCommand.class);
    addCommandGsonEqualityGroup(ReserveVmInterfaceVspCommand.class);
    addCommandGsonEqualityGroup(TrashNetworkVspCommand.class);
    addCommandGsonEqualityGroup(new SupportedApiVersionCommand("3.2"));
    addCommandGsonEqualityGroup(SyncDomainCommand.class);
    addCommandGsonEqualityGroup(SyncNuageVspCmsIdCommand.class);
    addCommandGsonEqualityGroup(PingNuageVspCommand.class);
    addCommandGsonEqualityGroup(new EntityExistsCommand(Command.class, "uuid"));
    tester.testEquals();
}
Also used : ShutDownVpcVspCommand(com.cloud.agent.api.element.ShutDownVpcVspCommand) ReserveVmInterfaceVspCommand(com.cloud.agent.api.guru.ReserveVmInterfaceVspCommand) SupportedApiVersionCommand(com.cloud.agent.api.manager.SupportedApiVersionCommand) ApplyStaticNatVspCommand(com.cloud.agent.api.element.ApplyStaticNatVspCommand) ApplyAclRuleVspCommand(com.cloud.agent.api.element.ApplyAclRuleVspCommand) EntityExistsCommand(com.cloud.agent.api.manager.EntityExistsCommand) TrashNetworkVspCommand(com.cloud.agent.api.guru.TrashNetworkVspCommand) ImplementVspCommand(com.cloud.agent.api.element.ImplementVspCommand) SyncNuageVspCmsIdCommand(com.cloud.agent.api.sync.SyncNuageVspCmsIdCommand) ImplementNetworkVspCommand(com.cloud.agent.api.guru.ImplementNetworkVspCommand) SyncDomainCommand(com.cloud.agent.api.sync.SyncDomainCommand) DeallocateVmVspCommand(com.cloud.agent.api.guru.DeallocateVmVspCommand) SupportedApiVersionCommand(com.cloud.agent.api.manager.SupportedApiVersionCommand) EntityExistsCommand(com.cloud.agent.api.manager.EntityExistsCommand) Test(org.junit.Test)

Example 3 with EntityExistsCommand

use of com.cloud.agent.api.manager.EntityExistsCommand in project cloudstack by apache.

the class NuageVspManagerImpl method updateNuageUnderlayVlanIpRange.

@Override
public boolean updateNuageUnderlayVlanIpRange(long vlanIpRangeId, boolean enabled) {
    VlanVO staticNatVlan = _vlanDao.findById(vlanIpRangeId);
    HostVO nuageVspHost = getNuageVspHost(staticNatVlan.getPhysicalNetworkId());
    EntityExistsCommand<Vlan> cmd = new EntityExistsCommand<Vlan>(Vlan.class, staticNatVlan.getUuid());
    Answer answer = _agentMgr.easySend(nuageVspHost.getId(), cmd);
    if (answer != null && !answer.getResult()) {
        _vlanDetailsDao.addDetail(staticNatVlan.getId(), NuageVspManager.nuageUnderlayVlanIpRangeDetailKey, String.valueOf(enabled), false);
        return true;
    }
    return false;
}
Also used : AgentControlAnswer(com.cloud.agent.api.AgentControlAnswer) Answer(com.cloud.agent.api.Answer) GetApiDefaultsAnswer(com.cloud.agent.api.manager.GetApiDefaultsAnswer) SyncNuageVspCmsIdAnswer(com.cloud.agent.api.sync.SyncNuageVspCmsIdAnswer) Vlan(com.cloud.dc.Vlan) VlanVO(com.cloud.dc.VlanVO) EntityExistsCommand(com.cloud.agent.api.manager.EntityExistsCommand) HostVO(com.cloud.host.HostVO)

Aggregations

EntityExistsCommand (com.cloud.agent.api.manager.EntityExistsCommand)3 SupportedApiVersionCommand (com.cloud.agent.api.manager.SupportedApiVersionCommand)2 Test (org.junit.Test)2 AgentControlAnswer (com.cloud.agent.api.AgentControlAnswer)1 Answer (com.cloud.agent.api.Answer)1 ApplyAclRuleVspCommand (com.cloud.agent.api.element.ApplyAclRuleVspCommand)1 ApplyStaticNatVspCommand (com.cloud.agent.api.element.ApplyStaticNatVspCommand)1 ImplementVspCommand (com.cloud.agent.api.element.ImplementVspCommand)1 ShutDownVpcVspCommand (com.cloud.agent.api.element.ShutDownVpcVspCommand)1 DeallocateVmVspCommand (com.cloud.agent.api.guru.DeallocateVmVspCommand)1 ImplementNetworkVspCommand (com.cloud.agent.api.guru.ImplementNetworkVspCommand)1 ReserveVmInterfaceVspCommand (com.cloud.agent.api.guru.ReserveVmInterfaceVspCommand)1 TrashNetworkVspCommand (com.cloud.agent.api.guru.TrashNetworkVspCommand)1 GetApiDefaultsAnswer (com.cloud.agent.api.manager.GetApiDefaultsAnswer)1 SyncDomainCommand (com.cloud.agent.api.sync.SyncDomainCommand)1 SyncNuageVspCmsIdAnswer (com.cloud.agent.api.sync.SyncNuageVspCmsIdAnswer)1 SyncNuageVspCmsIdCommand (com.cloud.agent.api.sync.SyncNuageVspCmsIdCommand)1 Vlan (com.cloud.dc.Vlan)1 VlanVO (com.cloud.dc.VlanVO)1 HostVO (com.cloud.host.HostVO)1