public SecurityRuleUpdatedImpl(SecurityRule secRule) { Date date= new Date(); timeStamp = new Timestamp(date.getTime()); securityRule = new NeutronSecurityRule(); securityRule.setSecurityRuleID(secRule.getUuid().getValue()); securityRule.setSecurityGroupID(secRule.getSecurityGroupId().getValue()); securityRule.setSecurityTenantID(secRule.getTenantId().getValue()); if (secRule.getDirection() != null) { securityRule.setSecurityRuleDirection(secRule.getDirection().getSimpleName()); } if (secRule.getProtocol() != null) { securityRule.setSecurityRuleProtocol(String.valueOf(secRule.getProtocol().getValue())); } if (secRule.getEthertype() != null) { securityRule.setSecurityRuleEthertype(secRule.getEthertype().getSimpleName()); } if (secRule.getRemoteIpPrefix() != null) { securityRule.setSecurityRuleRemoteIpPrefix(String.valueOf(secRule.getRemoteIpPrefix().getValue())); } if (secRule.getPortRangeMin() != null) { securityRule.setSecurityRulePortMin(secRule.getPortRangeMin()); } if (secRule.getPortRangeMax() != null) { securityRule.setSecurityRulePortMax(secRule.getPortRangeMax()); } } @Override
public SecurityRuleAddedImpl(SecurityRule secRule) { Date date= new Date(); timeStamp = new Timestamp(date.getTime()); securityRule = new NeutronSecurityRule(); securityRule.setSecurityRuleID(secRule.getUuid().getValue()); securityRule.setSecurityGroupID(secRule.getSecurityGroupId().getValue()); securityRule.setSecurityTenantID(secRule.getTenantId().getValue()); if (secRule.getDirection() != null) { securityRule.setSecurityRuleDirection(secRule.getDirection().getSimpleName()); } if (secRule.getProtocol() != null) { securityRule.setSecurityRuleProtocol(String.valueOf(secRule.getProtocol().getValue())); } if (secRule.getEthertype() != null) { securityRule.setSecurityRuleEthertype(secRule.getEthertype().getSimpleName()); } if (secRule.getRemoteIpPrefix() != null) { securityRule.setSecurityRuleRemoteIpPrefix(String.valueOf(secRule.getRemoteIpPrefix().getValue())); } if (secRule.getPortRangeMin() != null) { securityRule.setSecurityRulePortMin(secRule.getPortRangeMin()); } if (secRule.getPortRangeMax() != null) { securityRule.setSecurityRulePortMax(secRule.getPortRangeMax()); } }
public SecurityRuleDeletedImpl(SecurityRule secRule) { Date date= new Date(); timeStamp = new Timestamp(date.getTime()); securityRule = new NeutronSecurityRule(); securityRule.setSecurityRuleID(secRule.getUuid().getValue()); securityRule.setSecurityGroupID(secRule.getSecurityGroupId().getValue()); securityRule.setSecurityTenantID(secRule.getTenantId().getValue()); if (secRule.getDirection() != null) { securityRule.setSecurityRuleDirection(secRule.getDirection().getSimpleName()); } if (secRule.getProtocol() != null) { securityRule.setSecurityRuleProtocol(String.valueOf(secRule.getProtocol().getValue())); } if (secRule.getEthertype() != null) { securityRule.setSecurityRuleEthertype(secRule.getEthertype().getSimpleName()); } if (secRule.getRemoteIpPrefix() != null) { securityRule.setSecurityRuleRemoteIpPrefix(String.valueOf(secRule.getRemoteIpPrefix().getValue())); } if (secRule.getPortRangeMin() != null) { securityRule.setSecurityRulePortMin(secRule.getPortRangeMin()); } if (secRule.getPortRangeMax() != null) { securityRule.setSecurityRulePortMax(secRule.getPortRangeMax()); } } @Override