com.citrix.netscaler.nitro.resource.stat.ns.nsacl_stats Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nitro Show documentation
Show all versions of nitro Show documentation
The Citrix® NetScaler® NITRO client for Java allows you to configure and monitor the NetScaler appliance programmatically in Java based applications. Source code taken from Build 121 of NetScaler release 10.1
The newest version!
/*
* Copyright (c) 2008-2015 Citrix Systems, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.citrix.netscaler.nitro.resource.stat.ns;
import com.citrix.netscaler.nitro.resource.base.*;
import com.citrix.netscaler.nitro.service.nitro_service;
import com.citrix.netscaler.nitro.service.options;
import com.citrix.netscaler.nitro.util.*;
import com.citrix.netscaler.nitro.exception.nitro_exception;
class nsacl_response extends base_response
{
public nsacl_stats[] nsacl;
}
/**
* Statistics for ACL entry resource.
*/
public class nsacl_stats extends base_resource
{
private String aclname;
private String clearstats;
private Long acltotpktsbridged;
private Long aclpktsbridgedrate;
private Long acltotpktsdenied;
private Long aclpktsdeniedrate;
private Long acltotpktsallowed;
private Long aclpktsallowedrate;
private Long acltotpktsnat;
private Long aclpktsnatrate;
private Long acltothits;
private Long aclhitsrate;
private Long acltotmisses;
private Long aclmissesrate;
private Long acltotcount;
private Long aclperhits;
private Long aclperhitsrate;
/**
*
* Name of the extended ACL rule whose statistics you want the NetScaler appliance to display.
*
*/
public void set_aclname(String aclname) throws Exception{
this.aclname = aclname;
}
/**
*
* Name of the extended ACL rule whose statistics you want the NetScaler appliance to display.
Minimum length = 1
*
*/
public String get_aclname() throws Exception {
return this.aclname;
}
/**
*
* Clear the statsistics / counters
*
*/
public void set_clearstats(String clearstats) throws Exception{
this.clearstats = clearstats;
}
/**
*
* Clear the statsistics / counters.
Possible values = basic, full
*
*/
public String get_clearstats() throws Exception {
return this.clearstats;
}
/**
*
* Packets dropped because they match ACLs with processing mode set to DENY.
*
*/
public Long get_acltotpktsdenied() throws Exception {
return this.acltotpktsdenied;
}
/**
*
* Packets matching an ACL.
*
*/
public Long get_acltothits() throws Exception {
return this.acltothits;
}
/**
*
* Number of times the acl was hit
*
*/
public Long get_aclperhits() throws Exception {
return this.aclperhits;
}
/**
*
* Packets matching a NAT ACL, resulting in a NAT session.
*
*/
public Long get_acltotpktsnat() throws Exception {
return this.acltotpktsnat;
}
/**
*
* Rate (/s) counter for aclperhits
*
*/
public Long get_aclperhitsrate() throws Exception {
return this.aclperhitsrate;
}
/**
*
* Rate (/s) counter for acltotpktsdenied
*
*/
public Long get_aclpktsdeniedrate() throws Exception {
return this.aclpktsdeniedrate;
}
/**
*
* Rate (/s) counter for acltothits
*
*/
public Long get_aclhitsrate() throws Exception {
return this.aclhitsrate;
}
/**
*
* Rate (/s) counter for acltotpktsallowed
*
*/
public Long get_aclpktsallowedrate() throws Exception {
return this.aclpktsallowedrate;
}
/**
*
* Rate (/s) counter for acltotpktsnat
*
*/
public Long get_aclpktsnatrate() throws Exception {
return this.aclpktsnatrate;
}
/**
*
* Total number of ACL rules configured.
*
*/
public Long get_acltotcount() throws Exception {
return this.acltotcount;
}
/**
*
* Packets not matching any ACL.
*
*/
public Long get_acltotmisses() throws Exception {
return this.acltotmisses;
}
/**
*
* Packets matching ACLs with processing mode set to ALLOW. NetScaler processes these packets.
*
*/
public Long get_acltotpktsallowed() throws Exception {
return this.acltotpktsallowed;
}
/**
*
* Rate (/s) counter for acltotpktsbridged
*
*/
public Long get_aclpktsbridgedrate() throws Exception {
return this.aclpktsbridgedrate;
}
/**
*
* Packets matching a bridge ACL, which is in transparent mode and bypasses service processing.
*
*/
public Long get_acltotpktsbridged() throws Exception {
return this.acltotpktsbridged;
}
/**
*
* Rate (/s) counter for acltotmisses
*
*/
public Long get_aclmissesrate() throws Exception {
return this.aclmissesrate;
}
/**
*
* converts nitro response into object and returns the object array in case of get request.
*
*/
protected base_resource[] get_nitro_response(nitro_service service, String response) throws Exception{
nsacl_response result = (nsacl_response) service.get_payload_formatter().string_to_resource(nsacl_response.class, response);
if(result.errorcode != 0) {
if (result.errorcode == 444) {
service.clear_session();
}
if(result.severity != null)
{
if (result.severity.equals("ERROR"))
throw new nitro_exception(result.message,result.errorcode);
}
else
{
throw new nitro_exception(result.message,result.errorcode);
}
}
return result.nsacl;
}
/**
*
* Returns the value of object identifier argument
*
*/
protected String get_object_name() {
return this.aclname;
}
/**
* Use this API to fetch the statistics of all nsacl_stats resources that are configured on netscaler.
*/
public static nsacl_stats[] get(nitro_service service) throws Exception{
nsacl_stats obj = new nsacl_stats();
nsacl_stats[] response = (nsacl_stats[])obj.stat_resources(service);
return response;
}
/**
* Use this API to fetch the statistics of all nsacl_stats resources that are configured on netscaler.
*/
public static nsacl_stats[] get(nitro_service service, options option) throws Exception{
nsacl_stats obj = new nsacl_stats();
nsacl_stats[] response = (nsacl_stats[])obj.stat_resources(service,option);
return response;
}
/**
* Use this API to fetch statistics of nsacl_stats resource of given name .
*/
public static nsacl_stats get(nitro_service service, String aclname) throws Exception{
nsacl_stats obj = new nsacl_stats();
obj.set_aclname(aclname);
nsacl_stats response = (nsacl_stats) obj.stat_resource(service);
return response;
}
public static class clearstatsEnum {
public static final String basic = "basic";
public static final String full = "full";
}
}