com.citrix.netscaler.nitro.resource.config.rewrite.rewritepolicylabel 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.rewrite;
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 rewritepolicylabel_response extends base_response
{
public rewritepolicylabel[] rewritepolicylabel;
}
/**
* Configuration for rewrite policy label resource.
*/
public class rewritepolicylabel extends base_resource
{
private String labelname;
private String transform;
private String newname;
//------- Read only Parameter ---------;
private Long numpol;
private Long hits;
private Long priority;
private String gotopriorityexpression;
private String labeltype;
private String invoke_labelname;
private Long flowtype;
private String description;
private Boolean isdefault;
private Long __count;
/**
*
* Name for the rewrite policy label. Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) hash (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after the rewrite policy label is added.
The following requirement applies only to the NetScaler CLI:
If the name includes one or more spaces, enclose the name in double or single quotation marks (for example, "my rewrite policy label" or ?my rewrite policy label?).
*
*/
public void set_labelname(String labelname) throws Exception{
this.labelname = labelname;
}
/**
*
* Name for the rewrite policy label. Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) hash (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Cannot be changed after the rewrite policy label is added.
The following requirement applies only to the NetScaler CLI:
If the name includes one or more spaces, enclose the name in double or single quotation marks (for example, "my rewrite policy label" or ?my rewrite policy label?).
*
*/
public String get_labelname() throws Exception {
return this.labelname;
}
/**
*
* Types of transformations allowed by the policies bound to the label. For Rewrite, the following types are supported:
* http_req - HTTP requests
* http_res - HTTP responses
* othertcp_req - Non-HTTP TCP requests
* othertcp_res - Non-HTTP TCP responses
* url - URLs
* text - Text strings
* clientless_vpn_req - NetScaler clientless VPN requests
* clientless_vpn_res - NetScaler clientless VPN responses
* sipudp_req - SIP requests
* sipudp_res - SIP responses.
Possible values = http_req, http_res, othertcp_req, othertcp_res, url, text, clientless_vpn_req, clientless_vpn_res, sipudp_req, sipudp_res
*
*/
public void set_transform(String transform) throws Exception{
this.transform = transform;
}
/**
*
* Types of transformations allowed by the policies bound to the label. For Rewrite, the following types are supported:
* http_req - HTTP requests
* http_res - HTTP responses
* othertcp_req - Non-HTTP TCP requests
* othertcp_res - Non-HTTP TCP responses
* url - URLs
* text - Text strings
* clientless_vpn_req - NetScaler clientless VPN requests
* clientless_vpn_res - NetScaler clientless VPN responses
* sipudp_req - SIP requests
* sipudp_res - SIP responses.
Possible values = http_req, http_res, othertcp_req, othertcp_res, url, text, clientless_vpn_req, clientless_vpn_res, sipudp_req, sipudp_res
*
*/
public String get_transform() throws Exception {
return this.transform;
}
/**
*
* New name for the rewrite policy label.
Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) hash (#), space ( ), at (@), equals (=), colon (:), and underscore characters.
The following requirement applies only to the NetScaler CLI:
If the name includes one or more spaces, enclose the name in double or single quotation marks (for example, "my policy label" or ?my policy label?).
Minimum length = 1
*
*/
public void set_newname(String newname) throws Exception{
this.newname = newname;
}
/**
*
* New name for the rewrite policy label.
Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) hash (#), space ( ), at (@), equals (=), colon (:), and underscore characters.
The following requirement applies only to the NetScaler CLI:
If the name includes one or more spaces, enclose the name in double or single quotation marks (for example, "my policy label" or ?my policy label?).
Minimum length = 1
*
*/
public String get_newname() throws Exception {
return this.newname;
}
/**
*
* Number of polices bound to label.
*
*/
public Long get_numpol() throws Exception {
return this.numpol;
}
/**
*
* Number of times policy label was invoked.
*
*/
public Long get_hits() throws Exception {
return this.hits;
}
/**
*
* Specifies the priority of the policy.
*
*/
public Long get_priority() throws Exception {
return this.priority;
}
/**
*
* Expression specifying the priority of the next policy which will get evaluated if the current policy rule evaluates to TRUE.
*
*/
public String get_gotopriorityexpression() throws Exception {
return this.gotopriorityexpression;
}
/**
*
* Type of invocation. Available settings function as follows:
* reqvserver - Forward the request to the specified request virtual server.
* resvserver - Forward the response to the specified response virtual server.
* policylabel - Invoke the specified policy label.
Possible values = reqvserver, resvserver, policylabel
*
*/
public String get_labeltype() throws Exception {
return this.labeltype;
}
/**
*
* * If labelType is policylabel, name of the policy label to invoke.
* If labelType is reqvserver or resvserver, name of the virtual server to which to forward the request or response.
*
*/
public String get_invoke_labelname() throws Exception {
return this.invoke_labelname;
}
/**
*
* Flowtype of the bound rewrite policy.
*
*/
public Long get_flowtype() throws Exception {
return this.flowtype;
}
/**
*
* Description of the policylabel.
*
*/
public String get_description() throws Exception {
return this.description;
}
/**
*
* A value of true is returned if it is a default rewritepolicylabel.
*
*/
public Boolean get_isdefault() throws Exception {
return this.isdefault;
}
/**
*
* 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{
rewritepolicylabel_response result = (rewritepolicylabel_response) service.get_payload_formatter().string_to_resource(rewritepolicylabel_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.rewritepolicylabel;
}
/**
*
* Returns the value of object identifier argument
*
*/
protected String get_object_name() {
return this.labelname;
}
/**
* Use this API to add rewritepolicylabel.
*/
public static base_response add(nitro_service client, rewritepolicylabel resource) throws Exception {
rewritepolicylabel addresource = new rewritepolicylabel();
addresource.labelname = resource.labelname;
addresource.transform = resource.transform;
return addresource.add_resource(client);
}
/**
* Use this API to add rewritepolicylabel resources.
*/
public static base_responses add(nitro_service client, rewritepolicylabel resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
rewritepolicylabel addresources[] = new rewritepolicylabel[resources.length];
for (int i=0;i 0) {
rewritepolicylabel deleteresources[] = new rewritepolicylabel[labelname.length];
for (int i=0;i 0) {
rewritepolicylabel deleteresources[] = new rewritepolicylabel[resources.length];
for (int i=0;i0) {
rewritepolicylabel response[] = new rewritepolicylabel[labelname.length];
rewritepolicylabel obj[] = new rewritepolicylabel[labelname.length];
for (int i=0;i