com.citrix.netscaler.nitro.resource.config.network.netprofile 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.config.network;
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 netprofile_response extends base_response
{
public netprofile[] netprofile;
}
/**
* Configuration for Network profile resource.
*/
public class netprofile extends base_resource
{
private String name;
private Long td;
private String srcip;
private Long __count;
/**
*
* Name for the net profile. Must begin with a letter, number, or the underscore character (_), and can consist of letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at sign (@), equals (=), colon (:), and underscore characters. Cannot be changed after the profile is created. Choose a name that helps identify the net profile.
Minimum length = 1
*
*/
public void set_name(String name) throws Exception{
this.name = name;
}
/**
*
* Name for the net profile. Must begin with a letter, number, or the underscore character (_), and can consist of letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at sign (@), equals (=), colon (:), and underscore characters. Cannot be changed after the profile is created. Choose a name that helps identify the net profile.
Minimum length = 1
*
*/
public String get_name() throws Exception {
return this.name;
}
/**
*
* Traffic Domain Id.
Minimum value = 0
Maximum value = 4094
*
*/
public void set_td(long td) throws Exception {
this.td = new Long(td);
}
/**
*
* Traffic Domain Id.
Minimum value = 0
Maximum value = 4094
*
*/
public void set_td(Long td) throws Exception{
this.td = td;
}
/**
*
* Traffic Domain Id.
Minimum value = 0
Maximum value = 4094
*
*/
public Long get_td() throws Exception {
return this.td;
}
/**
*
* IP address or the name of an IP set.
*
*/
public void set_srcip(String srcip) throws Exception{
this.srcip = srcip;
}
/**
*
* IP address or the name of an IP set.
*
*/
public String get_srcip() throws Exception {
return this.srcip;
}
/**
*
* 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{
netprofile_response result = (netprofile_response) service.get_payload_formatter().string_to_resource(netprofile_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.netprofile;
}
/**
*
* Returns the value of object identifier argument
*
*/
protected String get_object_name() {
return this.name;
}
/**
* Use this API to add netprofile.
*/
public static base_response add(nitro_service client, netprofile resource) throws Exception {
netprofile addresource = new netprofile();
addresource.name = resource.name;
addresource.td = resource.td;
addresource.srcip = resource.srcip;
return addresource.add_resource(client);
}
/**
* Use this API to add netprofile resources.
*/
public static base_responses add(nitro_service client, netprofile resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
netprofile addresources[] = new netprofile[resources.length];
for (int i=0;i 0) {
netprofile deleteresources[] = new netprofile[name.length];
for (int i=0;i 0) {
netprofile deleteresources[] = new netprofile[resources.length];
for (int i=0;i 0) {
netprofile updateresources[] = new netprofile[resources.length];
for (int i=0;i 0) {
netprofile unsetresources[] = new netprofile[name.length];
for (int i=0;i 0) {
netprofile unsetresources[] = new netprofile[resources.length];
for (int i=0;i0) {
netprofile response[] = new netprofile[name.length];
netprofile obj[] = new netprofile[name.length];
for (int i=0;i