1818
1919import java .util .List ;
2020
21+ import org .apache .log4j .Logger ;
22+
23+ import org .apache .cloudstack .acl .IAMEntityType ;
2124import org .apache .cloudstack .api .APICommand ;
2225import org .apache .cloudstack .api .ApiCommandJobType ;
2326import org .apache .cloudstack .api .ApiConstants ;
3033import org .apache .cloudstack .api .response .IPAddressResponse ;
3134import org .apache .cloudstack .api .response .IpForwardingRuleResponse ;
3235import org .apache .cloudstack .context .CallContext ;
33- import org .apache .log4j .Logger ;
3436
3537import com .cloud .event .EventTypes ;
3638import com .cloud .exception .InvalidParameterValueException ;
@@ -126,7 +128,7 @@ public void execute() throws ResourceUnavailableException {
126128 StaticNatRule staticNatRule = _rulesService .buildStaticNatRule (rule , false );
127129 IpForwardingRuleResponse fwResponse = _responseGenerator .createIpForwardingRuleResponse (staticNatRule );
128130 fwResponse .setResponseName (getCommandName ());
129- this . setResponseObject (fwResponse );
131+ setResponseObject (fwResponse );
130132 } finally {
131133 if (!result || rule == null ) {
132134
@@ -152,8 +154,8 @@ public void create() {
152154
153155 try {
154156 StaticNatRule rule = _rulesService .createStaticNatRule (this , getOpenFirewall ());
155- this . setEntityId (rule .getId ());
156- this . setEntityUuid (rule .getUuid ());
157+ setEntityId (rule .getId ());
158+ setEntityUuid (rule .getUuid ());
157159 } catch (NetworkRuleConflictException e ) {
158160 s_logger .info ("Unable to create Static Nat Rule due to " , e );
159161 throw new ServerApiException (ApiErrorCode .NETWORK_RULE_CONFLICT_ERROR , e .getMessage ());
@@ -179,7 +181,7 @@ public String getEventType() {
179181 @ Override
180182 public String getEventDescription () {
181183 IpAddress ip = _networkService .getIp (ipAddressId );
182- return ("Applying an ipforwarding 1:1 NAT rule for Ip: " + ip .getAddress () + " with virtual machine:" + this . getVirtualMachineId ());
184+ return ("Applying an ipforwarding 1:1 NAT rule for Ip: " + ip .getAddress () + " with virtual machine:" + getVirtualMachineId ());
183185 }
184186
185187 private long getVirtualMachineId () {
@@ -321,4 +323,10 @@ public TrafficType getTrafficType() {
321323 public boolean isDisplay () {
322324 return true ;
323325 }
326+
327+ @ Override
328+ public IAMEntityType getEntityType () {
329+ return IAMEntityType .FirewallRule ;
330+ }
331+
324332}
0 commit comments