2222import java .io .InputStreamReader ;
2323import java .io .PrintWriter ;
2424import java .io .StringReader ;
25- import java .lang .String ;
2625import java .net .Socket ;
2726import java .net .SocketTimeoutException ;
2827import java .util .ArrayList ;
@@ -171,12 +170,12 @@ private enum SrxXml {
171170 ROLLBACK ("rollback.xml" ),
172171 TEST ("test.xml" );
173172
174- private String scriptsDir = "scripts/network/juniper" ;
175- private String xml ;
173+ private final String scriptsDir = "scripts/network/juniper" ;
174+ private final String xml ;
176175 private final Logger s_logger = Logger .getLogger (JuniperSrxResource .class );
177176
178177 private SrxXml (String filename ) {
179- this . xml = getXml (filename );
178+ xml = getXml (filename );
180179 }
181180
182181 public String getXml () {
@@ -209,9 +208,9 @@ private String getXml(String filename) {
209208 }
210209
211210 public class UsageFilter {
212- private String name ;
213- private String counterIdentifier ;
214- private String addressType ;
211+ private final String name ;
212+ private final String counterIdentifier ;
213+ private final String addressType ;
215214
216215 private UsageFilter (String name , String addressType , String counterIdentifier ) {
217216 this .name = name ;
@@ -238,14 +237,14 @@ public String getAddressType() {
238237 }
239238
240239 public class FirewallFilterTerm {
241- private String name ;
242- private List <String > sourceCidrs ;
243- private String destIp ;
240+ private final String name ;
241+ private final List <String > sourceCidrs ;
242+ private final String destIp ;
244243 private String portRange ;
245- private String protocol ;
244+ private final String protocol ;
246245 private String icmpType ;
247246 private String icmpCode ;
248- private String countName ;
247+ private final String countName ;
249248
250249 private FirewallFilterTerm (String name , List <String > sourceCidrs , String destIp , String protocol , Integer startPort , Integer endPort ,
251250 Integer icmpType , Integer icmpCode , String countName ) {
@@ -255,7 +254,7 @@ private FirewallFilterTerm(String name, List<String> sourceCidrs, String destIp,
255254 this .protocol = protocol ;
256255
257256 if (protocol .equals ("tcp" ) || protocol .equals ("udp" )) {
258- this . portRange = String .valueOf (startPort ) + "-" + String .valueOf (endPort );
257+ portRange = String .valueOf (startPort ) + "-" + String .valueOf (endPort );
259258 } else if (protocol .equals ("icmp" )) {
260259 this .icmpType = String .valueOf (icmpType );
261260 this .icmpCode = String .valueOf (icmpCode );
@@ -325,7 +324,7 @@ private enum SecurityPolicyType {
325324 SECURITYPOLICY_EGRESS ("egress" ),
326325 SECURITYPOLICY_EGRESS_DEFAULT ("egress-default" );
327326
328- private String identifier ;
327+ private final String identifier ;
329328
330329 private SecurityPolicyType (String identifier ) {
331330 this .identifier = identifier ;
@@ -336,6 +335,7 @@ private String getIdentifier() {
336335 }
337336 }
338337
338+ @ Override
339339 public Answer executeRequest (Command cmd ) {
340340 if (cmd instanceof ReadyCommand ) {
341341 return execute ((ReadyCommand ) cmd );
@@ -360,6 +360,7 @@ public Answer executeRequest(Command cmd) {
360360 }
361361 }
362362
363+ @ Override
363364 public boolean configure (String name , Map <String , Object > params ) throws ConfigurationException {
364365 try {
365366 _name = (String ) params .get ("name" );
@@ -443,6 +444,7 @@ public boolean configure(String name, Map<String, Object> params) throws Configu
443444
444445 }
445446
447+ @ Override
446448 public StartupCommand [] initialize () {
447449 StartupExternalFirewallCommand cmd = new StartupExternalFirewallCommand ();
448450 cmd .setName (_name );
@@ -455,6 +457,7 @@ public StartupCommand[] initialize() {
455457 return new StartupCommand []{cmd };
456458 }
457459
460+ @ Override
458461 public Host .Type getType () {
459462 return Host .Type .ExternalFirewall ;
460463 }
@@ -484,10 +487,12 @@ public void disconnected() {
484487 closeSocket ();
485488 }
486489
490+ @ Override
487491 public IAgentControl getAgentControl () {
488492 return null ;
489493 }
490494
495+ @ Override
491496 public void setAgentControl (IAgentControl agentControl ) {
492497 return ;
493498 }
0 commit comments