code
stringlengths
67
466k
docstring
stringlengths
1
13.2k
public static csvserver_appflowpolicy_binding[] get(nitro_service service, String name) throws Exception{ csvserver_appflowpolicy_binding obj = new csvserver_appflowpolicy_binding(); obj.set_name(name); csvserver_appflowpolicy_binding response[] = (csvserver_appflowpolicy_binding[]) obj.get_resources(service); return response; }
Use this API to fetch csvserver_appflowpolicy_binding resources of given name .
public static cachepolicy_cacheglobal_binding[] get(nitro_service service, String policyname) throws Exception{ cachepolicy_cacheglobal_binding obj = new cachepolicy_cacheglobal_binding(); obj.set_policyname(policyname); cachepolicy_cacheglobal_binding response[] = (cachepolicy_cacheglobal_binding[]) obj.get_resources(service); return response; }
Use this API to fetch cachepolicy_cacheglobal_binding resources of given name .
private void fixDocLengths(List<List<IN>> docs) { final int maxDocSize = flags.maxDocSize; WordToSentenceProcessor<IN> wts = new WordToSentenceProcessor<IN>(); List<List<IN>> newDocuments = new ArrayList<List<IN>>(); for (List<IN> document : docs) { if (maxDocSize <= 0 || document.size() <= maxDocSize) { if (!document.isEmpty()) { newDocuments.add(document); } continue; } List<List<IN>> sentences = wts.process(document); List<IN> newDocument = new ArrayList<IN>(); for (List<IN> sentence : sentences) { if (newDocument.size() + sentence.size() > maxDocSize) { if (!newDocument.isEmpty()) { newDocuments.add(newDocument); } newDocument = new ArrayList<IN>(); } newDocument.addAll(sentence); } if (!newDocument.isEmpty()) { newDocuments.add(newDocument); } } docs.clear(); docs.addAll(newDocuments); }
Take a {@link List} of documents (which are themselves {@link List}s of something that extends {@link CoreMap}, CoreLabel by default), and if any are longer than the length specified by flags.maxDocSize split them up. If maxDocSize is negative, nothing is changed. In practice, documents need to be not too long or else the CRF inference will fail due to numerical problems. This method tries to be smart and split on sentence boundaries, but this is hard-coded to English. @param docs The list of documents whose length might be adjusted.
public static sslglobal_sslpolicy_binding[] get(nitro_service service) throws Exception{ sslglobal_sslpolicy_binding obj = new sslglobal_sslpolicy_binding(); sslglobal_sslpolicy_binding response[] = (sslglobal_sslpolicy_binding[]) obj.get_resources(service); return response; }
Use this API to fetch a sslglobal_sslpolicy_binding resources.
public static sslglobal_sslpolicy_binding[] get_filtered(nitro_service service, filtervalue[] filter) throws Exception{ sslglobal_sslpolicy_binding obj = new sslglobal_sslpolicy_binding(); options option = new options(); option.set_filter(filter); sslglobal_sslpolicy_binding[] response = (sslglobal_sslpolicy_binding[]) obj.getfiltered(service, option); return response; }
Use this API to fetch filtered set of sslglobal_sslpolicy_binding resources. set the filter parameter values in filtervalue object.
public Collection<V> put(K key, Collection<V> collection) { return map.put(key, collection); }
Replaces current Collection mapped to key with the specified Collection. Use carefully!
public void add(K key, V value) { if (treatCollectionsAsImmutable) { Collection<V> newC = cf.newCollection(); Collection<V> c = map.get(key); if (c != null) { newC.addAll(c); } newC.add(value); map.put(key, newC); // replacing the old collection } else { Collection<V> c = map.get(key); if (c == null) { c = cf.newCollection(); map.put(key, c); } c.add(value); // modifying the old collection } }
Adds the value to the Collection mapped to by the key.
public void addAll(Map<K, V> m) { if (m instanceof CollectionValuedMap<?, ?>) { throw new UnsupportedOperationException(); } for (Map.Entry<K, V> e : m.entrySet()) { add(e.getKey(), e.getValue()); } }
Adds all of the mappings in m to this CollectionValuedMap. If m is a CollectionValuedMap, it will behave strangely. Use the constructor instead.
public void removeMapping(K key, V value) { if (treatCollectionsAsImmutable) { Collection<V> c = map.get(key); if (c != null) { Collection<V> newC = cf.newCollection(); newC.addAll(c); newC.remove(value); map.put(key, newC); } } else { Collection<V> c = get(key); c.remove(value); } }
Removes the value from the Collection mapped to by this key, leaving the rest of the collection intact. @param key the key to the Collection to remove the value from @param value the value to remove
public CollectionValuedMap<K, V> deltaClone() { CollectionValuedMap<K, V> result = new CollectionValuedMap<K, V>(null, cf, true); result.map = new DeltaMap<K, Collection<V>>(this.map); return result; }
Creates a "delta clone" of this Map, where only the differences are represented.
public static void main(String[] args) { CollectionValuedMap<Integer, Integer> originalMap = new CollectionValuedMap<Integer, Integer>(); /* for (int i=0; i<4; i++) { for (int j=0; j<4; j++) { originalMap.add(new Integer(i), new Integer(j)); } } originalMap.remove(new Integer(2)); System.out.println("Map: "); System.out.println(originalMap); System.exit(0); */ Random r = new Random(); for (int i = 0; i < 800; i++) { Integer rInt1 = Integer.valueOf(r.nextInt(400)); Integer rInt2 = Integer.valueOf(r.nextInt(400)); originalMap.add(rInt1, rInt2); System.out.println("Adding " + rInt1 + ' ' + rInt2); } CollectionValuedMap<Integer, Integer> originalCopyMap = new CollectionValuedMap<Integer, Integer>(originalMap); CollectionValuedMap<Integer, Integer> deltaCopyMap = new CollectionValuedMap<Integer, Integer>(originalMap); CollectionValuedMap<Integer, Integer> deltaMap = new DeltaCollectionValuedMap<Integer, Integer>(originalMap); // now make a lot of changes to deltaMap; // add and change some stuff for (int i = 0; i < 400; i++) { Integer rInt1 = Integer.valueOf(r.nextInt(400)); Integer rInt2 = Integer.valueOf(r.nextInt(400) + 1000); deltaMap.add(rInt1, rInt2); deltaCopyMap.add(rInt1, rInt2); System.out.println("Adding " + rInt1 + ' ' + rInt2); } // remove some stuff for (int i = 0; i < 400; i++) { Integer rInt1 = Integer.valueOf(r.nextInt(1400)); Integer rInt2 = Integer.valueOf(r.nextInt(1400)); deltaMap.removeMapping(rInt1, rInt2); deltaCopyMap.removeMapping(rInt1, rInt2); System.out.println("Removing " + rInt1 + ' ' + rInt2); } System.out.println("original: " + originalMap); System.out.println("copy: " + deltaCopyMap); System.out.println("delta: " + deltaMap); System.out.println("Original preserved? " + originalCopyMap.equals(originalMap)); System.out.println("Delta accurate? " + deltaMap.equals(deltaCopyMap)); }
For testing only. @param args from command line
public static linkset_interface_binding[] get(nitro_service service, String id) throws Exception{ linkset_interface_binding obj = new linkset_interface_binding(); obj.set_id(id); linkset_interface_binding response[] = (linkset_interface_binding[]) obj.get_resources(service); return response; }
Use this API to fetch linkset_interface_binding resources of given name .
public static long count(nitro_service service, String id) throws Exception{ linkset_interface_binding obj = new linkset_interface_binding(); obj.set_id(id); options option = new options(); option.set_count(true); linkset_interface_binding response[] = (linkset_interface_binding[]) obj.get_resources(service,option); if (response != null) { return response[0].__count; } return 0; }
Use this API to count linkset_interface_binding resources configued on NetScaler.
public static tmtrafficpolicy_lbvserver_binding[] get(nitro_service service, String name) throws Exception{ tmtrafficpolicy_lbvserver_binding obj = new tmtrafficpolicy_lbvserver_binding(); obj.set_name(name); tmtrafficpolicy_lbvserver_binding response[] = (tmtrafficpolicy_lbvserver_binding[]) obj.get_resources(service); return response; }
Use this API to fetch tmtrafficpolicy_lbvserver_binding resources of given name .
public static vlan_interface_binding[] get(nitro_service service, Long id) throws Exception{ vlan_interface_binding obj = new vlan_interface_binding(); obj.set_id(id); vlan_interface_binding response[] = (vlan_interface_binding[]) obj.get_resources(service); return response; }
Use this API to fetch vlan_interface_binding resources of given name .
public static rewritepolicy_csvserver_binding[] get(nitro_service service, String name) throws Exception{ rewritepolicy_csvserver_binding obj = new rewritepolicy_csvserver_binding(); obj.set_name(name); rewritepolicy_csvserver_binding response[] = (rewritepolicy_csvserver_binding[]) obj.get_resources(service); return response; }
Use this API to fetch rewritepolicy_csvserver_binding resources of given name .
public static tunneltrafficpolicy[] get(nitro_service service, options option) throws Exception{ tunneltrafficpolicy obj = new tunneltrafficpolicy(); tunneltrafficpolicy[] response = (tunneltrafficpolicy[])obj.get_resources(service,option); return response; }
Use this API to fetch all the tunneltrafficpolicy resources that are configured on netscaler.
public static tunneltrafficpolicy get(nitro_service service, String name) throws Exception{ tunneltrafficpolicy obj = new tunneltrafficpolicy(); obj.set_name(name); tunneltrafficpolicy response = (tunneltrafficpolicy) obj.get_resource(service); return response; }
Use this API to fetch tunneltrafficpolicy resource of given name .
public static tunneltrafficpolicy[] get_filtered(nitro_service service, String filter) throws Exception{ tunneltrafficpolicy obj = new tunneltrafficpolicy(); options option = new options(); option.set_filter(filter); tunneltrafficpolicy[] response = (tunneltrafficpolicy[]) obj.getfiltered(service, option); return response; }
Use this API to fetch filtered set of tunneltrafficpolicy resources. filter string should be in JSON format.eg: "port:80,servicetype:HTTP".
public static vpnglobal_intranetip_binding[] get(nitro_service service) throws Exception{ vpnglobal_intranetip_binding obj = new vpnglobal_intranetip_binding(); vpnglobal_intranetip_binding response[] = (vpnglobal_intranetip_binding[]) obj.get_resources(service); return response; }
Use this API to fetch a vpnglobal_intranetip_binding resources.
public static vpnglobal_intranetip_binding[] get_filtered(nitro_service service, String filter) throws Exception{ vpnglobal_intranetip_binding obj = new vpnglobal_intranetip_binding(); options option = new options(); option.set_filter(filter); vpnglobal_intranetip_binding[] response = (vpnglobal_intranetip_binding[]) obj.getfiltered(service, option); return response; }
Use this API to fetch filtered set of vpnglobal_intranetip_binding resources. filter string should be in JSON format.eg: "port:80,servicetype:HTTP".
public static base_response add(nitro_service client, sslaction resource) throws Exception { sslaction addresource = new sslaction(); addresource.name = resource.name; addresource.clientauth = resource.clientauth; addresource.clientcert = resource.clientcert; addresource.certheader = resource.certheader; addresource.clientcertserialnumber = resource.clientcertserialnumber; addresource.certserialheader = resource.certserialheader; addresource.clientcertsubject = resource.clientcertsubject; addresource.certsubjectheader = resource.certsubjectheader; addresource.clientcerthash = resource.clientcerthash; addresource.certhashheader = resource.certhashheader; addresource.clientcertissuer = resource.clientcertissuer; addresource.certissuerheader = resource.certissuerheader; addresource.sessionid = resource.sessionid; addresource.sessionidheader = resource.sessionidheader; addresource.cipher = resource.cipher; addresource.cipherheader = resource.cipherheader; addresource.clientcertnotbefore = resource.clientcertnotbefore; addresource.certnotbeforeheader = resource.certnotbeforeheader; addresource.clientcertnotafter = resource.clientcertnotafter; addresource.certnotafterheader = resource.certnotafterheader; addresource.owasupport = resource.owasupport; return addresource.add_resource(client); }
Use this API to add sslaction.
public static base_responses add(nitro_service client, sslaction resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { sslaction addresources[] = new sslaction[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new sslaction(); addresources[i].name = resources[i].name; addresources[i].clientauth = resources[i].clientauth; addresources[i].clientcert = resources[i].clientcert; addresources[i].certheader = resources[i].certheader; addresources[i].clientcertserialnumber = resources[i].clientcertserialnumber; addresources[i].certserialheader = resources[i].certserialheader; addresources[i].clientcertsubject = resources[i].clientcertsubject; addresources[i].certsubjectheader = resources[i].certsubjectheader; addresources[i].clientcerthash = resources[i].clientcerthash; addresources[i].certhashheader = resources[i].certhashheader; addresources[i].clientcertissuer = resources[i].clientcertissuer; addresources[i].certissuerheader = resources[i].certissuerheader; addresources[i].sessionid = resources[i].sessionid; addresources[i].sessionidheader = resources[i].sessionidheader; addresources[i].cipher = resources[i].cipher; addresources[i].cipherheader = resources[i].cipherheader; addresources[i].clientcertnotbefore = resources[i].clientcertnotbefore; addresources[i].certnotbeforeheader = resources[i].certnotbeforeheader; addresources[i].clientcertnotafter = resources[i].clientcertnotafter; addresources[i].certnotafterheader = resources[i].certnotafterheader; addresources[i].owasupport = resources[i].owasupport; } result = add_bulk_request(client, addresources); } return result; }
Use this API to add sslaction resources.
public static sslaction[] get(nitro_service service) throws Exception{ sslaction obj = new sslaction(); sslaction[] response = (sslaction[])obj.get_resources(service); return response; }
Use this API to fetch all the sslaction resources that are configured on netscaler.
public static sslaction get(nitro_service service, String name) throws Exception{ sslaction obj = new sslaction(); obj.set_name(name); sslaction response = (sslaction) obj.get_resource(service); return response; }
Use this API to fetch sslaction resource of given name .
public static sslaction[] get_filtered(nitro_service service, String filter) throws Exception{ sslaction obj = new sslaction(); options option = new options(); option.set_filter(filter); sslaction[] response = (sslaction[]) obj.getfiltered(service, option); return response; }
Use this API to fetch filtered set of sslaction resources. filter string should be in JSON format.eg: "port:80,servicetype:HTTP".
public static rewriteglobal_binding get(nitro_service service) throws Exception{ rewriteglobal_binding obj = new rewriteglobal_binding(); rewriteglobal_binding response = (rewriteglobal_binding) obj.get_resource(service); return response; }
Use this API to fetch a rewriteglobal_binding resource .
public static vpath_stats get(nitro_service service) throws Exception{ vpath_stats obj = new vpath_stats(); vpath_stats[] response = (vpath_stats[])obj.stat_resources(service); return response[0]; }
Use this API to fetch the statistics of all vpath_stats resources that are configured on netscaler.
private void computeDir(double[] dir, double[] fg, QNInfo qn) throws SurpriseConvergence { System.arraycopy(fg, 0, dir, 0, fg.length); int mmm = qn.size(); double[] as = new double[mmm]; for (int i = mmm - 1; i >= 0; i--) { as[i] = qn.getRho(i) * ArrayMath.innerProduct(qn.getS(i), dir); plusAndConstMult(dir, qn.getY(i), -as[i], dir); } // multiply by hessian approximation qn.applyInitialHessian(dir); for (int i = 0; i < mmm; i++) { double b = qn.getRho(i) * ArrayMath.innerProduct(qn.getY(i), dir); plusAndConstMult(dir, qn.getS(i), as[i] - b, dir); } ArrayMath.multiplyInPlace(dir, -1); }
/* computeDir() This function will calculate an approximation of the inverse hessian based off the seen s,y vector pairs. This particular approximation uses the BFGS update.
private static double[] plusAndConstMult(double[] a, double[] b, double c, double[] d) { for (int i = 0; i < a.length; i++) { d[i] = a[i] + c * b[i]; } return d; }
computes d = a + b * c
private double[] lineSearchBacktrack(Function func, double[] dir, double[] x, double[] newX, double[] grad, double lastValue) throws MaxEvaluationsExceeded { double normGradInDir = ArrayMath.innerProduct(dir, grad); say("(" + nf.format(normGradInDir) + ")"); if (normGradInDir > 0) { say("{WARNING--- direction of positive gradient chosen!}"); } // c1 can be anything between 0 and 1, exclusive (usu. 1/10 - 1/2) double step, c1; // for first few steps, we have less confidence in our initial step-size a // so scale back quicker if (its <= 2) { step = 0.1; c1 = 0.1; } else { step = 1.0; c1 = 0.1; } // should be small e.g. 10^-5 ... 10^-1 double c = 0.01; // double v = func.valueAt(x); // c = c * mult(grad, dir); c = c * normGradInDir; double[] newPoint = new double[3]; while ((newPoint[f] = func.valueAt((plusAndConstMult(x, dir, step, newX)))) > lastValue + c * step) { fevals += 1; if (newPoint[f] < lastValue) { // an improvement, but not good enough... suspicious! say("!"); } else { say("."); } step = c1 * step; } newPoint[a] = step; fevals += 1; if (fevals > maxFevals) { throw new MaxEvaluationsExceeded( " Exceeded during linesearch() Function "); } return newPoint; }
/* lineSearchBacktrack is the original linesearch used for the first version of QNMinimizer. it only satisfies sufficient descent not the Wolfe conditions.
private int getStep(double[] x, double[] dir, double[] newX, double f0, double g0, double[] newPt, double[] bestPt, double[] endPt, double stpMin, double stpMax) throws MaxEvaluationsExceeded { int info = 0; // Should check for input errors. boolean bound = false; double theta, gamma, p, q, r, s, stpc, stpq, stpf; double signG = newPt[g] * bestPt[g] / Math.abs(bestPt[g]); // // First case. A higher function value. // The minimum is bracketed. If the cubic step is closer // to stx than the quadratic step, the cubic step is taken, // else the average of the cubic and quadratic steps is taken. // if (newPt[f] > bestPt[f]) { info = 1; bound = true; theta = 3 * (bestPt[f] - newPt[f]) / (newPt[a] - bestPt[a]) + bestPt[g] + newPt[g]; s = Math.max(Math.max(theta, newPt[g]), bestPt[g]); gamma = s * Math.sqrt((theta / s) * (theta / s) - (bestPt[g] / s) * (newPt[g] / s)); if (newPt[a] < bestPt[a]) { gamma = -gamma; } p = (gamma - bestPt[g]) + theta; q = ((gamma - bestPt[g]) + gamma) + newPt[g]; r = p / q; stpc = bestPt[a] + r * (newPt[a] - bestPt[a]); stpq = bestPt[a] + ((bestPt[g] / ((bestPt[f] - newPt[f]) / (newPt[a] - bestPt[a]) + bestPt[g])) / 2) * (newPt[a] - bestPt[a]); if (Math.abs(stpc - bestPt[a]) < Math.abs(stpq - bestPt[a])) { stpf = stpc; } else { stpf = stpq; // stpf = stpc + (stpq - stpc)/2; } bracketed = true; if (newPt[a] < 0.1) { stpf = 0.01 * stpf; } } else if (signG < 0.0) { // // Second case. A lower function value and derivatives of // opposite sign. The minimum is bracketed. If the cubic // step is closer to stx than the quadratic (secant) step, // the cubic step is taken, else the quadratic step is taken. // info = 2; bound = false; theta = 3 * (bestPt[f] - newPt[f]) / (newPt[a] - bestPt[a]) + bestPt[g] + newPt[g]; s = Math.max(Math.max(theta, bestPt[g]), newPt[g]); gamma = s * Math.sqrt((theta / s) * (theta / s) - (bestPt[g] / s) * (newPt[g] / s)); if (newPt[a] > bestPt[a]) { gamma = -gamma; } p = (gamma - newPt[g]) + theta; q = ((gamma - newPt[g]) + gamma) + bestPt[g]; r = p / q; stpc = newPt[a] + r * (bestPt[a] - newPt[a]); stpq = newPt[a] + (newPt[g] / (newPt[g] - bestPt[g])) * (bestPt[a] - newPt[a]); if (Math.abs(stpc - newPt[a]) > Math.abs(stpq - newPt[a])) { stpf = stpc; } else { stpf = stpq; } bracketed = true; } else if (Math.abs(newPt[g]) < Math.abs(bestPt[g])) { // // Third case. A lower function value, derivatives of the // same sign, and the magnitude of the derivative decreases. // The cubic step is only used if the cubic tends to infinity // in the direction of the step or if the minimum of the cubic // is beyond stp. Otherwise the cubic step is defined to be // either stpmin or stpmax. The quadratic (secant) step is also // computed and if the minimum is bracketed then the the step // closest to stx is taken, else the step farthest away is taken. // info = 3; bound = true; theta = 3 * (bestPt[f] - newPt[f]) / (newPt[a] - bestPt[a]) + bestPt[g] + newPt[g]; s = Math.max(Math.max(theta, bestPt[g]), newPt[g]); gamma = s * Math.sqrt(Math.max(0.0, (theta / s) * (theta / s) - (bestPt[g] / s) * (newPt[g] / s))); if (newPt[a] < bestPt[a]) { gamma = -gamma; } p = (gamma - bestPt[g]) + theta; q = ((gamma - bestPt[g]) + gamma) + newPt[g]; r = p / q; if (r < 0.0 && gamma != 0.0) { stpc = newPt[a] + r * (bestPt[a] - newPt[a]); } else if (newPt[a] > bestPt[a]) { stpc = stpMax; } else { stpc = stpMin; } stpq = newPt[a] + (newPt[g] / (newPt[g] - bestPt[g])) * (bestPt[a] - newPt[a]); if (bracketed) { if (Math.abs(newPt[a] - stpc) < Math.abs(newPt[a] - stpq)) { stpf = stpc; } else { stpf = stpq; } } else { if (Math.abs(newPt[a] - stpc) > Math.abs(newPt[a] - stpq)) { stpf = stpc; } else { stpf = stpq; } } } else { // // Fourth case. A lower function value, derivatives of the // same sign, and the magnitude of the derivative does // not decrease. If the minimum is not bracketed, the step // is either stpmin or stpmax, else the cubic step is taken. // info = 4; bound = false; if (bracketed) { theta = 3 * (bestPt[f] - newPt[f]) / (newPt[a] - bestPt[a]) + bestPt[g] + newPt[g]; s = Math.max(Math.max(theta, bestPt[g]), newPt[g]); gamma = s * Math.sqrt((theta / s) * (theta / s) - (bestPt[g] / s) * (newPt[g] / s)); if (newPt[a] > bestPt[a]) { gamma = -gamma; } p = (gamma - newPt[g]) + theta; q = ((gamma - newPt[g]) + gamma) + bestPt[g]; r = p / q; stpc = newPt[a] + r * (bestPt[a] - newPt[a]); stpf = stpc; } else if (newPt[a] > bestPt[a]) { stpf = stpMax; } else { stpf = stpMin; } } // // Update the interval of uncertainty. This update does not // depend on the new step or the case analysis above. // if (newPt[f] > bestPt[f]) { copy(newPt, endPt); } else { if (signG < 0.0) { copy(bestPt, endPt); } copy(newPt, bestPt); } say(String.valueOf(info)); // // Compute the new step and safeguard it. // stpf = Math.min(stpMax, stpf); stpf = Math.max(stpMin, stpf); newPt[a] = stpf; if (bracketed && bound) { if (endPt[a] > bestPt[a]) { newPt[a] = Math.min(bestPt[a] + p66 * (endPt[a] - bestPt[a]), newPt[a]); } else { newPt[a] = Math.max(bestPt[a] + p66 * (endPt[a] - bestPt[a]), newPt[a]); } } return info; }
/* getStep() THIS FUNCTION IS A TRANSLATION OF A TRANSLATION OF THE MINPACK SUBROUTINE cstep(). Dianne O'Leary July 1991 It was then interpreted from matlab implementation supplied by Andrew Bradley. Modification have been made for this particular application. This function is used to find a new safe guarded step to be used for linesearch procedures. Comments in the function were also taken from the matlab implementation.
public static aaauser_auditsyslogpolicy_binding[] get(nitro_service service, String username) throws Exception{ aaauser_auditsyslogpolicy_binding obj = new aaauser_auditsyslogpolicy_binding(); obj.set_username(username); aaauser_auditsyslogpolicy_binding response[] = (aaauser_auditsyslogpolicy_binding[]) obj.get_resources(service); return response; }
Use this API to fetch aaauser_auditsyslogpolicy_binding resources of given name .
@Override public MtasSpanWeight createWeight(IndexSearcher searcher, boolean needsScores, float boost) throws IOException { return new SpanAllWeight(searcher, null, boost); }
/* (non-Javadoc) @see org.apache.lucene.search.spans.SpanQuery#createWeight(org.apache.lucene. search.IndexSearcher, boolean)
public static lbvserver_cachepolicy_binding[] get(nitro_service service, String name) throws Exception{ lbvserver_cachepolicy_binding obj = new lbvserver_cachepolicy_binding(); obj.set_name(name); lbvserver_cachepolicy_binding response[] = (lbvserver_cachepolicy_binding[]) obj.get_resources(service); return response; }
Use this API to fetch lbvserver_cachepolicy_binding resources of given name .
public static tunnelip_stats[] get(nitro_service service) throws Exception{ tunnelip_stats obj = new tunnelip_stats(); tunnelip_stats[] response = (tunnelip_stats[])obj.stat_resources(service); return response; }
Use this API to fetch the statistics of all tunnelip_stats resources that are configured on netscaler.
public static tunnelip_stats get(nitro_service service, String tunnelip) throws Exception{ tunnelip_stats obj = new tunnelip_stats(); obj.set_tunnelip(tunnelip); tunnelip_stats response = (tunnelip_stats) obj.stat_resource(service); return response; }
Use this API to fetch statistics of tunnelip_stats resource of given name .
public void updateSequenceElement(int[] sequence, int pos, int oldVal) { if(models != null){ for(int i = 0; i < models.length; i++) models[i].updateSequenceElement(sequence, pos, oldVal); return; } model1.updateSequenceElement(sequence, pos, 0); model2.updateSequenceElement(sequence, pos, 0); }
Informs this sequence model that the value of the element at position pos has changed. This allows this sequence model to update its internal model if desired.
public void setInitialSequence(int[] sequence) { if(models != null){ for(int i = 0; i < models.length; i++) models[i].setInitialSequence(sequence); return; } model1.setInitialSequence(sequence); model2.setInitialSequence(sequence); }
Informs this sequence model that the value of the whole sequence is initialized to sequence
public static DelimitRegExIterator<String> defaultDelimitRegExIterator(Reader in, String delimiter) { return new DelimitRegExIterator<String>(in, delimiter, new IdentityFunction<String>()); }
TODO: not sure if this is the best way to name things...
public static <T> IteratorFromReaderFactory<T> getFactory(String delim, Function<String,T> op) { return new DelimitRegExIteratorFactory<T>(delim, op); }
Returns a factory that vends DelimitRegExIterators that reads the contents of the given Reader, splits on the specified delimiter, applies op, then returns the result.
public static lbmonbindings_servicegroup_binding[] get(nitro_service service, String monitorname) throws Exception{ lbmonbindings_servicegroup_binding obj = new lbmonbindings_servicegroup_binding(); obj.set_monitorname(monitorname); lbmonbindings_servicegroup_binding response[] = (lbmonbindings_servicegroup_binding[]) obj.get_resources(service); return response; }
Use this API to fetch lbmonbindings_servicegroup_binding resources of given name .
public void run() { final TimerTaskData taskData = task.getData(); final Serializable taskID = taskData.getTaskID(); if (logger.isDebugEnabled()) { logger.debug("Cancelling timer task for timer ID "+taskID); } scheduler.getLocalRunningTasksMap().remove(taskID); try { task.cancel(); } catch (Throwable e) { logger.error(e.getMessage(),e); } }
/* (non-Javadoc) @see java.lang.Runnable#run()
public final void garbageCollect() { if (timeout != null && !data.isEmpty()) { long boundaryTime = System.currentTimeMillis() - (garbageTimeout); data.removeIf((MtasSolrStatus solrStatus) -> solrStatus.finished() || solrStatus.getStartTime() < boundaryTime); index.clear(); data.forEach((MtasSolrStatus solrStatus) -> index.put(solrStatus.key(), solrStatus)); } }
/* (non-Javadoc) @see mtas.solr.handler.util.MtasSolrBaseList#garbageCollect()
public final List<MtasSolrStatus> checkForExceptions() { List<MtasSolrStatus> statusWithException = null; for (MtasSolrStatus item : data) { if (item.checkResponseForException()) { if (statusWithException == null) { statusWithException = new ArrayList<>(); } statusWithException.add(item); } } return statusWithException; }
Check for exceptions. @return the list
public static authenticationradiuspolicy_authenticationvserver_binding[] get(nitro_service service, String name) throws Exception{ authenticationradiuspolicy_authenticationvserver_binding obj = new authenticationradiuspolicy_authenticationvserver_binding(); obj.set_name(name); authenticationradiuspolicy_authenticationvserver_binding response[] = (authenticationradiuspolicy_authenticationvserver_binding[]) obj.get_resources(service); return response; }
Use this API to fetch authenticationradiuspolicy_authenticationvserver_binding resources of given name .
public static vpnvserver_authenticationsamlpolicy_binding[] get(nitro_service service, String name) throws Exception{ vpnvserver_authenticationsamlpolicy_binding obj = new vpnvserver_authenticationsamlpolicy_binding(); obj.set_name(name); vpnvserver_authenticationsamlpolicy_binding response[] = (vpnvserver_authenticationsamlpolicy_binding[]) obj.get_resources(service); return response; }
Use this API to fetch vpnvserver_authenticationsamlpolicy_binding resources of given name .
public static base_response convert(nitro_service client, sslpkcs8 resource) throws Exception { sslpkcs8 convertresource = new sslpkcs8(); convertresource.pkcs8file = resource.pkcs8file; convertresource.keyfile = resource.keyfile; convertresource.keyform = resource.keyform; convertresource.password = resource.password; return convertresource.perform_operation(client,"convert"); }
Use this API to convert sslpkcs8.
public static ci[] get(nitro_service service) throws Exception{ ci obj = new ci(); ci[] response = (ci[])obj.get_resources(service); return response; }
Use this API to fetch all the ci resources that are configured on netscaler.
public static ci[] get_filtered(nitro_service service, String filter) throws Exception{ ci obj = new ci(); options option = new options(); option.set_filter(filter); ci[] response = (ci[]) obj.getfiltered(service, option); return response; }
Use this API to fetch filtered set of ci resources. filter string should be in JSON format.eg: "port:80,servicetype:HTTP".
public static base_response add(nitro_service client, sslcipher resource) throws Exception { sslcipher addresource = new sslcipher(); addresource.ciphergroupname = resource.ciphergroupname; addresource.ciphgrpalias = resource.ciphgrpalias; return addresource.add_resource(client); }
Use this API to add sslcipher.
public static base_responses add(nitro_service client, sslcipher resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { sslcipher addresources[] = new sslcipher[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new sslcipher(); addresources[i].ciphergroupname = resources[i].ciphergroupname; addresources[i].ciphgrpalias = resources[i].ciphgrpalias; } result = add_bulk_request(client, addresources); } return result; }
Use this API to add sslcipher resources.
public static base_response delete(nitro_service client, String ciphergroupname) throws Exception { sslcipher deleteresource = new sslcipher(); deleteresource.ciphergroupname = ciphergroupname; return deleteresource.delete_resource(client); }
Use this API to delete sslcipher of given name.
public static base_responses delete(nitro_service client, String ciphergroupname[]) throws Exception { base_responses result = null; if (ciphergroupname != null && ciphergroupname.length > 0) { sslcipher deleteresources[] = new sslcipher[ciphergroupname.length]; for (int i=0;i<ciphergroupname.length;i++){ deleteresources[i] = new sslcipher(); deleteresources[i].ciphergroupname = ciphergroupname[i]; } result = delete_bulk_request(client, deleteresources); } return result; }
Use this API to delete sslcipher resources of given names.
public static sslcipher[] get(nitro_service service) throws Exception{ sslcipher obj = new sslcipher(); sslcipher[] response = (sslcipher[])obj.get_resources(service); return response; }
Use this API to fetch all the sslcipher resources that are configured on netscaler.
public static sslcipher get(nitro_service service, String ciphergroupname) throws Exception{ sslcipher obj = new sslcipher(); obj.set_ciphergroupname(ciphergroupname); sslcipher response = (sslcipher) obj.get_resource(service); return response; }
Use this API to fetch sslcipher resource of given name .
public static sslcipher[] get(nitro_service service, String ciphergroupname[]) throws Exception{ if (ciphergroupname !=null && ciphergroupname.length>0) { sslcipher response[] = new sslcipher[ciphergroupname.length]; sslcipher obj[] = new sslcipher[ciphergroupname.length]; for (int i=0;i<ciphergroupname.length;i++) { obj[i] = new sslcipher(); obj[i].set_ciphergroupname(ciphergroupname[i]); response[i] = (sslcipher) obj[i].get_resource(service); } return response; } return null; }
Use this API to fetch sslcipher resources of given names .
public static sslcipher[] get_filtered(nitro_service service, String filter) throws Exception{ sslcipher obj = new sslcipher(); options option = new options(); option.set_filter(filter); sslcipher[] response = (sslcipher[]) obj.getfiltered(service, option); return response; }
Use this API to fetch filtered set of sslcipher resources. filter string should be in JSON format.eg: "port:80,servicetype:HTTP".
public static base_response add(nitro_service client, transformpolicy resource) throws Exception { transformpolicy addresource = new transformpolicy(); addresource.name = resource.name; addresource.rule = resource.rule; addresource.profilename = resource.profilename; addresource.comment = resource.comment; addresource.logaction = resource.logaction; return addresource.add_resource(client); }
Use this API to add transformpolicy.
public static base_response update(nitro_service client, transformpolicy resource) throws Exception { transformpolicy updateresource = new transformpolicy(); updateresource.name = resource.name; updateresource.rule = resource.rule; updateresource.profilename = resource.profilename; updateresource.comment = resource.comment; updateresource.logaction = resource.logaction; return updateresource.update_resource(client); }
Use this API to update transformpolicy.
public static transformpolicy[] get(nitro_service service) throws Exception{ transformpolicy obj = new transformpolicy(); transformpolicy[] response = (transformpolicy[])obj.get_resources(service); return response; }
Use this API to fetch all the transformpolicy resources that are configured on netscaler.
public static transformpolicy get(nitro_service service, String name) throws Exception{ transformpolicy obj = new transformpolicy(); obj.set_name(name); transformpolicy response = (transformpolicy) obj.get_resource(service); return response; }
Use this API to fetch transformpolicy resource of given name .
public static transformpolicy[] get_filtered(nitro_service service, String filter) throws Exception{ transformpolicy obj = new transformpolicy(); options option = new options(); option.set_filter(filter); transformpolicy[] response = (transformpolicy[]) obj.getfiltered(service, option); return response; }
Use this API to fetch filtered set of transformpolicy resources. filter string should be in JSON format.eg: "port:80,servicetype:HTTP".
public int compareTo(WordTag wordTag) { int first = (word != null ? word().compareTo(wordTag.word()) : 0); if(first != 0) return first; else { if (tag() == null) { if (wordTag.tag() == null) return 0; else return -1; } return tag().compareTo(wordTag.tag()); } }
Orders first by word, then by tag. @param wordTag object to compare to @return result (positive if <code>this</code> is greater than <code>obj</code>, 0 if equal, negative otherwise)
public void ensureCapacity(int minCapacity) { if (table.length < minCapacity) { int newCapacity = nextPrime(minCapacity); rehash(newCapacity); } }
Ensures that the receiver can hold at least the specified number of associations without needing to allocate new internal memory. If necessary, allocates new internal memory and increases the capacity of the receiver. <p> This method never need be called; it is for performance tuning only. Calling this method before <tt>put()</tt>ing a large number of associations boosts performance, because the receiver will grow only once instead of potentially many times and hash collisions get less probable. @param minCapacity the desired minimum capacity.
public long keyOf(int value) { //returns the first key found; there may be more matching keys, however. int i = indexOfValue(value); if (i<0) return Long.MIN_VALUE; return table[i]; }
Returns the first key the given value is associated with. It is often a good idea to first check with {@link #containsValue(int)} whether there exists an association from a key to this value. Search order is guaranteed to be <i>identical</i> to the order used by method {@link #forEachKey(LongProcedure)}. @param value the value to search for. @return the first key for which holds <tt>get(key) == value</tt>; returns <tt>Long.MIN_VALUE</tt> if no such key exists.
public boolean put(long key, int value) { int i = indexOfInsertion(key); if (i<0) { //already contained i = -i -1; this.values[i]=value; return false; } if (this.distinct > this.highWaterMark) { int newCapacity = chooseGrowCapacity(this.distinct+1,this.minLoadFactor, this.maxLoadFactor); rehash(newCapacity); return put(key, value); } this.table[i]=key; this.values[i]=value; if (this.state[i]==FREE) this.freeEntries--; this.state[i]=FULL; this.distinct++; if (this.freeEntries < 1) { //delta int newCapacity = chooseGrowCapacity(this.distinct+1,this.minLoadFactor, this.maxLoadFactor); rehash(newCapacity); } return true; }
Associates the given key with the given value. Replaces any old <tt>(key,someOtherValue)</tt> association, if existing. @param key the key the value shall be associated with. @param value the value to be associated. @return <tt>true</tt> if the receiver did not already contain such a key; <tt>false</tt> if the receiver did already contain such a key - the new value has now replaced the formerly associated value.
protected void rehash(int newCapacity) { int oldCapacity = table.length; //if (oldCapacity == newCapacity) return; long oldTable[] = table; int oldValues[] = values; byte oldState[] = state; long newTable[] = new long[newCapacity]; int newValues[] = new int[newCapacity]; byte newState[] = new byte[newCapacity]; this.lowWaterMark = chooseLowWaterMark(newCapacity,this.minLoadFactor); this.highWaterMark = chooseHighWaterMark(newCapacity,this.maxLoadFactor); this.table = newTable; this.values = newValues; this.state = newState; this.freeEntries = newCapacity-this.distinct; // delta for (int i = oldCapacity ; i-- > 0 ;) { if (oldState[i]==FULL) { long element = oldTable[i]; int index = indexOfInsertion(element); newTable[index]=element; newValues[index]=oldValues[i]; newState[index]=FULL; } } }
Rehashes the contents of the receiver into a new table with a smaller or larger capacity. This method is called automatically when the number of keys in the receiver exceeds the high water mark or falls below the low water mark.
public boolean removeKey(long key) { int i = indexOfKey(key); if (i<0) return false; // key not contained this.state[i]=REMOVED; this.values[i]=0; // delta this.distinct--; if (this.distinct < this.lowWaterMark) { int newCapacity = chooseShrinkCapacity(this.distinct,this.minLoadFactor, this.maxLoadFactor); rehash(newCapacity); } return true; }
Removes the given key with its associated element from the receiver, if present. @param key the key to be removed from the receiver. @return <tt>true</tt> if the receiver contained the specified key, <tt>false</tt> otherwise.
public static DocumentBuilder getXmlParser() { DocumentBuilder db = null; try { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setValidating(false); //Disable DTD loading and validation //See http://stackoverflow.com/questions/155101/make-documentbuilder-parse-ignore-dtd-references dbf.setFeature("http://apache.org/xml/features/nonvalidating/load-dtd-grammar", false); dbf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); db = dbf.newDocumentBuilder(); db.setErrorHandler(new SAXErrorHandler()); } catch (ParserConfigurationException e) { System.err.printf("%s: Unable to create XML parser\n", XMLUtils.class.getName()); e.printStackTrace(); } catch(UnsupportedOperationException e) { System.err.printf("%s: API error while setting up XML parser. Check your JAXP version\n", XMLUtils.class.getName()); e.printStackTrace(); } return db; }
Returns a non-validating XML parser. The parser ignores both DTDs and XSDs. @return An XML parser in the form of a DocumentBuilder
public static DocumentBuilder getValidatingXmlParser(File schemaFile) { DocumentBuilder db = null; try { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); Schema schema = factory.newSchema(schemaFile); dbf.setSchema(schema); db = dbf.newDocumentBuilder(); db.setErrorHandler(new SAXErrorHandler()); } catch (ParserConfigurationException e) { System.err.printf("%s: Unable to create XML parser\n", XMLUtils.class.getName()); e.printStackTrace(); } catch (SAXException e) { System.err.printf("%s: XML parsing exception while loading schema %s\n", XMLUtils.class.getName(),schemaFile.getPath()); e.printStackTrace(); } catch(UnsupportedOperationException e) { System.err.printf("%s: API error while setting up XML parser. Check your JAXP version\n", XMLUtils.class.getName()); e.printStackTrace(); } return db; }
Returns a validating XML parser given an XSD (not DTD!). @param schemaFile @return An XML parser in the form of a DocumentBuilder
public static String readUntilTag(Reader r) throws IOException { if (!r.ready()) { return ""; } StringBuilder b = new StringBuilder(); int c = r.read(); while (c >= 0 && c != '<') { b.append((char) c); c = r.read(); } return b.toString(); }
Reads all text up to next XML tag and returns it as a String. @return the String of the text read, which may be empty.
public static String escapeElementXML(String in) { int leng = in.length(); StringBuilder sb = new StringBuilder(leng); for (int i = 0; i < leng; i++) { char c = in.charAt(i); if (c == '&') { sb.append("&amp;"); } else if (c == '<') { sb.append("&lt;"); } else if (c == '>') { sb.append("&gt;"); } else { sb.append(c); } } return sb.toString(); }
Returns a String in which some the XML special characters have been escaped: just the ones that need escaping in an element content. @param in The String to escape @return The escaped String
public static int findSpace(String haystack, int begin) { int space = haystack.indexOf(' ', begin); int nbsp = haystack.indexOf('\u00A0', begin); if (space == -1 && nbsp == -1) { return -1; } else if (space >= 0 && nbsp >= 0) { return Math.min(space, nbsp); } else { // eg one is -1, and the other is >= 0 return Math.max(space, nbsp); } }
return either the first space or the first nbsp
public static String readTag(Reader r) throws IOException { if ( ! r.ready()) { return null; } StringBuilder b = new StringBuilder("<"); int c = r.read(); while (c >= 0) { b.append((char) c); if (c == '>') { break; } c = r.read(); } if (b.length() == 1) { return null; } return b.toString(); }
Reads all text of the XML tag and returns it as a String. Assumes that a '<' character has already been read. @param r The reader to read from @return The String representing the tag, or null if one couldn't be read (i.e., EOF). The returned item is a complete tag including angle brackets, such as <code>&lt;TXT&gt;</code>
public static Document readDocumentFromString(String s) throws Exception { InputSource in = new InputSource(new StringReader(s)); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setNamespaceAware(false); return factory.newDocumentBuilder().parse(in); }
end class SAXErrorHandler
public static void main(String[] args) throws Exception { if (args[0].equals("-readDoc")) { Document doc = readDocumentFromFile(args[1]); System.out.println(doc); } else { String s = IOUtils.slurpFile(args[0]); Reader r = new StringReader(s); String tag = readTag(r); while (tag.length() > 0) { readUntilTag(r); tag = readTag(r); if (tag.length() == 0) { break; } System.out.println("got tag=" + new XMLTag(tag)); } } }
Tests a few methods. If the first arg is -readDoc then this method tests readDocumentFromFile. Otherwise, it tests readTag/readUntilTag and slurpFile.
public static base_response update(nitro_service client, rsskeytype resource) throws Exception { rsskeytype updateresource = new rsskeytype(); updateresource.rsstype = resource.rsstype; return updateresource.update_resource(client); }
Use this API to update rsskeytype.
public static rsskeytype get(nitro_service service) throws Exception{ rsskeytype obj = new rsskeytype(); rsskeytype[] response = (rsskeytype[])obj.get_resources(service); return response[0]; }
Use this API to fetch all the rsskeytype resources that are configured on netscaler.
public static vpntrafficpolicy_vpnglobal_binding[] get(nitro_service service, String name) throws Exception{ vpntrafficpolicy_vpnglobal_binding obj = new vpntrafficpolicy_vpnglobal_binding(); obj.set_name(name); vpntrafficpolicy_vpnglobal_binding response[] = (vpntrafficpolicy_vpnglobal_binding[]) obj.get_resources(service); return response; }
Use this API to fetch vpntrafficpolicy_vpnglobal_binding resources of given name .
public static tmglobal_tmsessionpolicy_binding[] get(nitro_service service) throws Exception{ tmglobal_tmsessionpolicy_binding obj = new tmglobal_tmsessionpolicy_binding(); tmglobal_tmsessionpolicy_binding response[] = (tmglobal_tmsessionpolicy_binding[]) obj.get_resources(service); return response; }
Use this API to fetch a tmglobal_tmsessionpolicy_binding resources.
public static tmglobal_tmsessionpolicy_binding[] get_filtered(nitro_service service, String filter) throws Exception{ tmglobal_tmsessionpolicy_binding obj = new tmglobal_tmsessionpolicy_binding(); options option = new options(); option.set_filter(filter); tmglobal_tmsessionpolicy_binding[] response = (tmglobal_tmsessionpolicy_binding[]) obj.getfiltered(service, option); return response; }
Use this API to fetch filtered set of tmglobal_tmsessionpolicy_binding resources. filter string should be in JSON format.eg: "port:80,servicetype:HTTP".
@Override public MtasSpanWeight createWeight(IndexSearcher searcher, boolean needsScores, float boost) throws IOException { SpanWeight subWeight = subQuery.createWeight(searcher, needsScores, boost); return new MtasDisabledTwoPhaseIteratorWeight(subWeight, searcher, needsScores, boost); }
/* (non-Javadoc) @see mtas.search.spans.util.MtasSpanQuery#createWeight(org.apache.lucene.search. IndexSearcher, boolean)
@Override public MtasSpanQuery rewrite(IndexReader reader) throws IOException { MtasSpanQuery newQ = subQuery.rewrite(reader); if (newQ == null) { newQ = new MtasSpanMatchNoneQuery(subQuery.getField()); return new MtasDisabledTwoPhaseIteratorSpanQuery(newQ); } else { newQ.disableTwoPhaseIterator(); if (!newQ.equals(subQuery)) { return new MtasDisabledTwoPhaseIteratorSpanQuery(newQ).rewrite(reader); } else { return super.rewrite(reader); } } }
/* (non-Javadoc) @see mtas.search.spans.util.MtasSpanQuery#rewrite(org.apache.lucene.index. IndexReader)
public static systemglobal_authenticationldappolicy_binding[] get(nitro_service service) throws Exception{ systemglobal_authenticationldappolicy_binding obj = new systemglobal_authenticationldappolicy_binding(); systemglobal_authenticationldappolicy_binding response[] = (systemglobal_authenticationldappolicy_binding[]) obj.get_resources(service); return response; }
Use this API to fetch a systemglobal_authenticationldappolicy_binding resources.
public static systemglobal_authenticationldappolicy_binding[] get_filtered(nitro_service service, String filter) throws Exception{ systemglobal_authenticationldappolicy_binding obj = new systemglobal_authenticationldappolicy_binding(); options option = new options(); option.set_filter(filter); systemglobal_authenticationldappolicy_binding[] response = (systemglobal_authenticationldappolicy_binding[]) obj.getfiltered(service, option); return response; }
Use this API to fetch filtered set of systemglobal_authenticationldappolicy_binding resources. filter string should be in JSON format.eg: "port:80,servicetype:HTTP".
public static authenticationvserver_authenticationradiuspolicy_binding[] get(nitro_service service, String name) throws Exception{ authenticationvserver_authenticationradiuspolicy_binding obj = new authenticationvserver_authenticationradiuspolicy_binding(); obj.set_name(name); authenticationvserver_authenticationradiuspolicy_binding response[] = (authenticationvserver_authenticationradiuspolicy_binding[]) obj.get_resources(service); return response; }
Use this API to fetch authenticationvserver_authenticationradiuspolicy_binding resources of given name .
public static auditnslogpolicy_authenticationvserver_binding[] get(nitro_service service, String name) throws Exception{ auditnslogpolicy_authenticationvserver_binding obj = new auditnslogpolicy_authenticationvserver_binding(); obj.set_name(name); auditnslogpolicy_authenticationvserver_binding response[] = (auditnslogpolicy_authenticationvserver_binding[]) obj.get_resources(service); return response; }
Use this API to fetch auditnslogpolicy_authenticationvserver_binding resources of given name .
public static vlan_nsip6_binding[] get(nitro_service service, Long id) throws Exception{ vlan_nsip6_binding obj = new vlan_nsip6_binding(); obj.set_id(id); vlan_nsip6_binding response[] = (vlan_nsip6_binding[]) obj.get_resources(service); return response; }
Use this API to fetch vlan_nsip6_binding resources of given name .
public static appflowpolicylabel[] get(nitro_service service) throws Exception{ appflowpolicylabel obj = new appflowpolicylabel(); appflowpolicylabel[] response = (appflowpolicylabel[])obj.get_resources(service); return response; }
Use this API to fetch all the appflowpolicylabel resources that are configured on netscaler.
public static appflowpolicylabel get(nitro_service service, String labelname) throws Exception{ appflowpolicylabel obj = new appflowpolicylabel(); obj.set_labelname(labelname); appflowpolicylabel response = (appflowpolicylabel) obj.get_resource(service); return response; }
Use this API to fetch appflowpolicylabel resource of given name .
public static appflowpolicylabel[] get_filtered(nitro_service service, String filter) throws Exception{ appflowpolicylabel obj = new appflowpolicylabel(); options option = new options(); option.set_filter(filter); appflowpolicylabel[] response = (appflowpolicylabel[]) obj.getfiltered(service, option); return response; }
Use this API to fetch filtered set of appflowpolicylabel resources. filter string should be in JSON format.eg: "port:80,servicetype:HTTP".
public static nslimitidentifier_stats[] get(nitro_service service) throws Exception{ nslimitidentifier_stats obj = new nslimitidentifier_stats(); nslimitidentifier_stats[] response = (nslimitidentifier_stats[])obj.stat_resources(service); return response; }
Use this API to fetch the statistics of all nslimitidentifier_stats resources that are configured on netscaler.
public static nslimitidentifier_stats get(nitro_service service, String name) throws Exception{ nslimitidentifier_stats obj = new nslimitidentifier_stats(); obj.set_name(name); nslimitidentifier_stats response = (nslimitidentifier_stats) obj.stat_resource(service); return response; }
Use this API to fetch statistics of nslimitidentifier_stats resource of given name .
public static base_response add(nitro_service client, cachecontentgroup resource) throws Exception { cachecontentgroup addresource = new cachecontentgroup(); addresource.name = resource.name; addresource.weakposrelexpiry = resource.weakposrelexpiry; addresource.heurexpiryparam = resource.heurexpiryparam; addresource.relexpiry = resource.relexpiry; addresource.relexpirymillisec = resource.relexpirymillisec; addresource.absexpiry = resource.absexpiry; addresource.absexpirygmt = resource.absexpirygmt; addresource.weaknegrelexpiry = resource.weaknegrelexpiry; addresource.hitparams = resource.hitparams; addresource.invalparams = resource.invalparams; addresource.ignoreparamvaluecase = resource.ignoreparamvaluecase; addresource.matchcookies = resource.matchcookies; addresource.invalrestrictedtohost = resource.invalrestrictedtohost; addresource.polleverytime = resource.polleverytime; addresource.ignorereloadreq = resource.ignorereloadreq; addresource.removecookies = resource.removecookies; addresource.prefetch = resource.prefetch; addresource.prefetchperiod = resource.prefetchperiod; addresource.prefetchperiodmillisec = resource.prefetchperiodmillisec; addresource.prefetchmaxpending = resource.prefetchmaxpending; addresource.flashcache = resource.flashcache; addresource.expireatlastbyte = resource.expireatlastbyte; addresource.insertvia = resource.insertvia; addresource.insertage = resource.insertage; addresource.insertetag = resource.insertetag; addresource.cachecontrol = resource.cachecontrol; addresource.quickabortsize = resource.quickabortsize; addresource.minressize = resource.minressize; addresource.maxressize = resource.maxressize; addresource.memlimit = resource.memlimit; addresource.ignorereqcachinghdrs = resource.ignorereqcachinghdrs; addresource.minhits = resource.minhits; addresource.alwaysevalpolicies = resource.alwaysevalpolicies; addresource.persist = resource.persist; addresource.pinned = resource.pinned; addresource.lazydnsresolve = resource.lazydnsresolve; addresource.hitselector = resource.hitselector; addresource.invalselector = resource.invalselector; addresource.type = resource.type; return addresource.add_resource(client); }
Use this API to add cachecontentgroup.
public static base_responses add(nitro_service client, cachecontentgroup resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { cachecontentgroup addresources[] = new cachecontentgroup[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new cachecontentgroup(); addresources[i].name = resources[i].name; addresources[i].weakposrelexpiry = resources[i].weakposrelexpiry; addresources[i].heurexpiryparam = resources[i].heurexpiryparam; addresources[i].relexpiry = resources[i].relexpiry; addresources[i].relexpirymillisec = resources[i].relexpirymillisec; addresources[i].absexpiry = resources[i].absexpiry; addresources[i].absexpirygmt = resources[i].absexpirygmt; addresources[i].weaknegrelexpiry = resources[i].weaknegrelexpiry; addresources[i].hitparams = resources[i].hitparams; addresources[i].invalparams = resources[i].invalparams; addresources[i].ignoreparamvaluecase = resources[i].ignoreparamvaluecase; addresources[i].matchcookies = resources[i].matchcookies; addresources[i].invalrestrictedtohost = resources[i].invalrestrictedtohost; addresources[i].polleverytime = resources[i].polleverytime; addresources[i].ignorereloadreq = resources[i].ignorereloadreq; addresources[i].removecookies = resources[i].removecookies; addresources[i].prefetch = resources[i].prefetch; addresources[i].prefetchperiod = resources[i].prefetchperiod; addresources[i].prefetchperiodmillisec = resources[i].prefetchperiodmillisec; addresources[i].prefetchmaxpending = resources[i].prefetchmaxpending; addresources[i].flashcache = resources[i].flashcache; addresources[i].expireatlastbyte = resources[i].expireatlastbyte; addresources[i].insertvia = resources[i].insertvia; addresources[i].insertage = resources[i].insertage; addresources[i].insertetag = resources[i].insertetag; addresources[i].cachecontrol = resources[i].cachecontrol; addresources[i].quickabortsize = resources[i].quickabortsize; addresources[i].minressize = resources[i].minressize; addresources[i].maxressize = resources[i].maxressize; addresources[i].memlimit = resources[i].memlimit; addresources[i].ignorereqcachinghdrs = resources[i].ignorereqcachinghdrs; addresources[i].minhits = resources[i].minhits; addresources[i].alwaysevalpolicies = resources[i].alwaysevalpolicies; addresources[i].persist = resources[i].persist; addresources[i].pinned = resources[i].pinned; addresources[i].lazydnsresolve = resources[i].lazydnsresolve; addresources[i].hitselector = resources[i].hitselector; addresources[i].invalselector = resources[i].invalselector; addresources[i].type = resources[i].type; } result = add_bulk_request(client, addresources); } return result; }
Use this API to add cachecontentgroup resources.
public static base_response update(nitro_service client, cachecontentgroup resource) throws Exception { cachecontentgroup updateresource = new cachecontentgroup(); updateresource.name = resource.name; updateresource.weakposrelexpiry = resource.weakposrelexpiry; updateresource.heurexpiryparam = resource.heurexpiryparam; updateresource.relexpiry = resource.relexpiry; updateresource.relexpirymillisec = resource.relexpirymillisec; updateresource.absexpiry = resource.absexpiry; updateresource.absexpirygmt = resource.absexpirygmt; updateresource.weaknegrelexpiry = resource.weaknegrelexpiry; updateresource.hitparams = resource.hitparams; updateresource.invalparams = resource.invalparams; updateresource.ignoreparamvaluecase = resource.ignoreparamvaluecase; updateresource.matchcookies = resource.matchcookies; updateresource.invalrestrictedtohost = resource.invalrestrictedtohost; updateresource.polleverytime = resource.polleverytime; updateresource.ignorereloadreq = resource.ignorereloadreq; updateresource.removecookies = resource.removecookies; updateresource.prefetch = resource.prefetch; updateresource.prefetchperiod = resource.prefetchperiod; updateresource.prefetchperiodmillisec = resource.prefetchperiodmillisec; updateresource.prefetchmaxpending = resource.prefetchmaxpending; updateresource.flashcache = resource.flashcache; updateresource.expireatlastbyte = resource.expireatlastbyte; updateresource.insertvia = resource.insertvia; updateresource.insertage = resource.insertage; updateresource.insertetag = resource.insertetag; updateresource.cachecontrol = resource.cachecontrol; updateresource.quickabortsize = resource.quickabortsize; updateresource.minressize = resource.minressize; updateresource.maxressize = resource.maxressize; updateresource.memlimit = resource.memlimit; updateresource.ignorereqcachinghdrs = resource.ignorereqcachinghdrs; updateresource.minhits = resource.minhits; updateresource.alwaysevalpolicies = resource.alwaysevalpolicies; updateresource.persist = resource.persist; updateresource.pinned = resource.pinned; updateresource.lazydnsresolve = resource.lazydnsresolve; updateresource.hitselector = resource.hitselector; updateresource.invalselector = resource.invalselector; return updateresource.update_resource(client); }
Use this API to update cachecontentgroup.
public static base_response expire(nitro_service client, cachecontentgroup resource) throws Exception { cachecontentgroup expireresource = new cachecontentgroup(); expireresource.name = resource.name; return expireresource.perform_operation(client,"expire"); }
Use this API to expire cachecontentgroup.
public static base_responses expire(nitro_service client, cachecontentgroup resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { cachecontentgroup expireresources[] = new cachecontentgroup[resources.length]; for (int i=0;i<resources.length;i++){ expireresources[i] = new cachecontentgroup(); expireresources[i].name = resources[i].name; } result = perform_operation_bulk_request(client, expireresources,"expire"); } return result; }
Use this API to expire cachecontentgroup resources.
public static base_response flush(nitro_service client, cachecontentgroup resource) throws Exception { cachecontentgroup flushresource = new cachecontentgroup(); flushresource.name = resource.name; flushresource.query = resource.query; flushresource.host = resource.host; flushresource.selectorvalue = resource.selectorvalue; flushresource.force = resource.force; return flushresource.perform_operation(client,"flush"); }
Use this API to flush cachecontentgroup.