code
stringlengths
73
34.1k
label
stringclasses
1 value
public static base_response enable(nitro_service client, String acl6name) throws Exception { nsacl6 enableresource = new nsacl6(); enableresource.acl6name = acl6name; return enableresource.perform_operation(client,"enable"); }
java
public static base_responses enable(nitro_service client, String acl6name[]) throws Exception { base_responses result = null; if (acl6name != null && acl6name.length > 0) { nsacl6 enableresources[] = new nsacl6[acl6name.length]; for (int i=0;i<acl6name.length;i++){ enableresources[i] = new nsacl6(); enableresources[i].acl6name = acl6name[i]; } result = perform_operation_bulk_request(client, enableresources,"enable"); } return result; }
java
public static base_response disable(nitro_service client, nsacl6 resource) throws Exception { nsacl6 disableresource = new nsacl6(); disableresource.acl6name = resource.acl6name; return disableresource.perform_operation(client,"disable"); }
java
public static base_responses disable(nitro_service client, String acl6name[]) throws Exception { base_responses result = null; if (acl6name != null && acl6name.length > 0) { nsacl6 disableresources[] = new nsacl6[acl6name.length]; for (int i=0;i<acl6name.length;i++){ disableresources[i] = new nsacl6(); disableresources[i].acl6name = acl6name[i]; } result = perform_operation_bulk_request(client, disableresources,"disable"); } return result; }
java
public static base_response rename(nitro_service client, nsacl6 resource, String new_acl6name) throws Exception { nsacl6 renameresource = new nsacl6(); renameresource.acl6name = resource.acl6name; return renameresource.rename_resource(client,new_acl6name); }
java
public static nsacl6[] get(nitro_service service) throws Exception{ nsacl6 obj = new nsacl6(); nsacl6[] response = (nsacl6[])obj.get_resources(service); return response; }
java
public static nsacl6 get(nitro_service service, String acl6name) throws Exception{ nsacl6 obj = new nsacl6(); obj.set_acl6name(acl6name); nsacl6 response = (nsacl6) obj.get_resource(service); return response; }
java
public static nsacl6[] get(nitro_service service, String acl6name[]) throws Exception{ if (acl6name !=null && acl6name.length>0) { nsacl6 response[] = new nsacl6[acl6name.length]; nsacl6 obj[] = new nsacl6[acl6name.length]; for (int i=0;i<acl6name.length;i++) { obj[i] = new nsacl6(); obj[i].set_acl6name(acl6name[i]); response[i] = (nsacl6) obj[i].get_resource(service); } return response; } return null; }
java
public static service_dospolicy_binding[] get(nitro_service service, String name) throws Exception{ service_dospolicy_binding obj = new service_dospolicy_binding(); obj.set_name(name); service_dospolicy_binding response[] = (service_dospolicy_binding[]) obj.get_resources(service); return response; }
java
public static appfwprofile_csrftag_binding[] get(nitro_service service, String name) throws Exception{ appfwprofile_csrftag_binding obj = new appfwprofile_csrftag_binding(); obj.set_name(name); appfwprofile_csrftag_binding response[] = (appfwprofile_csrftag_binding[]) obj.get_resources(service); return response; }
java
public static dnsview_binding get(nitro_service service, String viewname) throws Exception{ dnsview_binding obj = new dnsview_binding(); obj.set_viewname(viewname); dnsview_binding response = (dnsview_binding) obj.get_resource(service); return response; }
java
public static base_response update(nitro_service client, nsspparams resource) throws Exception { nsspparams updateresource = new nsspparams(); updateresource.basethreshold = resource.basethreshold; updateresource.throttle = resource.throttle; return updateresource.update_resource(client); }
java
public static base_response unset(nitro_service client, nsspparams resource, String[] args) throws Exception{ nsspparams unsetresource = new nsspparams(); return unsetresource.unset_resource(client,args); }
java
public static nsspparams get(nitro_service service) throws Exception{ nsspparams obj = new nsspparams(); nsspparams[] response = (nsspparams[])obj.get_resources(service); return response[0]; }
java
public static List<Integer> asList(int[] a) { List<Integer> result = new ArrayList<Integer>(a.length); for (int i = 0; i < a.length; i++) { result.add(Integer.valueOf(a[i])); } return result; }
java
public static <T> List<T> makeList(T... items) { List<T> s = new ArrayList<T>(items.length); for (int i = 0; i < items.length; i++) { s.add(items[i]); } return s; }
java
public static <T> Set<T> asSet(T[] o) { return new HashSet<T>(Arrays.asList(o)); }
java
public static <T> Collection<T> diff(Collection<T> list1, Collection<T> list2) { Collection<T> diff = new ArrayList<T>(); for (T t : list1) { if (!list2.contains(t)) { diff.add(t); } } return diff; }
java
public static <E> Collection<E> sampleWithoutReplacement(Collection<E> c, int n) { return sampleWithoutReplacement(c, n, new Random()); }
java
public static <E> Collection<E> sampleWithReplacement(Collection<E> c, int n) { return sampleWithReplacement(c, n, new Random()); }
java
public static <T extends Comparable<T>> int compareLists(List<T> list1, List<T> list2) { if (list1 == null && list2 == null) return 0; if (list1 == null || list2 == null) { throw new IllegalArgumentException(); } int size1 = list1.size(); int size2 = list2.size(); int size = Math.min(size1, size2); for (int i = 0; i < size; i++) { int c = list1.get(i).compareTo(list2.get(i)); if (c != 0) return c; } if (size1 < size2) return -1; if (size1 > size2) return 1; return 0; }
java
public static <T> List<T> toList(Iterable<T> items) { List<T> list = new ArrayList<T>(); addAll(list, items); return list; }
java
public static <T> Set<T> toSet(Iterable<T> items) { Set<T> set = new HashSet<T>(); addAll(set, items); return set; }
java
public static <T> void addAll(Collection<T> collection, Iterable<? extends T> items) { for (T item : items) { collection.add(item); } }
java
public static <T> List<List<T>> getNGrams(List<T> items, int minSize, int maxSize) { List<List<T>> ngrams = new ArrayList<List<T>>(); int listSize = items.size(); for (int i = 0; i < listSize; ++i) { for (int ngramSize = minSize; ngramSize <= maxSize; ++ngramSize) { if (i + ngramSize <= listSize) { List<T> ngram = new ArrayList<T>(); for (int j = i; j < i + ngramSize; ++j) { ngram.add(items.get(j)); } ngrams.add(ngram); } } } return ngrams; }
java
public static <T> List<T> flatten(Collection<List<T>> nestedList) { List<T> result = new ArrayList<T>(); for (List<T> list : nestedList) { result.addAll(list); } return result; }
java
public static <ObjType, Hashable> Collection<ObjType> uniqueNonhashableObjects(Collection<ObjType> objects, Function<ObjType, Hashable> customHasher) { Map<Hashable, ObjType> hashesToObjects = new HashMap<Hashable, ObjType>(); for (ObjType object : objects) { hashesToObjects.put(customHasher.apply(object), object); } return hashesToObjects.values(); }
java
public static <T> boolean containsAny(Collection<T> collection, Collection<T> toCheck){ for(T c: toCheck){ if(collection.contains(c)) return true; } return false; }
java
public static <T> T mode(Collection<T> values) { Set<T> modes = modes(values); return modes.iterator().next(); }
java
public static crvserver_binding get(nitro_service service, String name) throws Exception{ crvserver_binding obj = new crvserver_binding(); obj.set_name(name); crvserver_binding response = (crvserver_binding) obj.get_resource(service); return response; }
java
public static base_response restore(nitro_service client, appfwprofile resource) throws Exception { appfwprofile restoreresource = new appfwprofile(); restoreresource.archivename = resource.archivename; return restoreresource.perform_operation(client,"restore"); }
java
public static base_responses restore(nitro_service client, appfwprofile resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { appfwprofile restoreresources[] = new appfwprofile[resources.length]; for (int i=0;i<resources.length;i++){ restoreresources[i] = new appfwprofile(); restoreresources[i].archivename = resources[i].archivename; } result = perform_operation_bulk_request(client, restoreresources,"restore"); } return result; }
java
public static appfwprofile[] get(nitro_service service) throws Exception{ appfwprofile obj = new appfwprofile(); appfwprofile[] response = (appfwprofile[])obj.get_resources(service); return response; }
java
public static appfwprofile get(nitro_service service, String name) throws Exception{ appfwprofile obj = new appfwprofile(); obj.set_name(name); appfwprofile response = (appfwprofile) obj.get_resource(service); return response; }
java
public static base_response add(nitro_service client, route6 resource) throws Exception { route6 addresource = new route6(); addresource.network = resource.network; addresource.gateway = resource.gateway; addresource.vlan = resource.vlan; addresource.weight = resource.weight; addresource.distance = resource.distance; addresource.cost = resource.cost; addresource.advertise = resource.advertise; addresource.msr = resource.msr; addresource.monitor = resource.monitor; addresource.td = resource.td; return addresource.add_resource(client); }
java
public static base_responses add(nitro_service client, route6 resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { route6 addresources[] = new route6[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new route6(); addresources[i].network = resources[i].network; addresources[i].gateway = resources[i].gateway; addresources[i].vlan = resources[i].vlan; addresources[i].weight = resources[i].weight; addresources[i].distance = resources[i].distance; addresources[i].cost = resources[i].cost; addresources[i].advertise = resources[i].advertise; addresources[i].msr = resources[i].msr; addresources[i].monitor = resources[i].monitor; addresources[i].td = resources[i].td; } result = add_bulk_request(client, addresources); } return result; }
java
public static base_response clear(nitro_service client, route6 resource) throws Exception { route6 clearresource = new route6(); clearresource.routetype = resource.routetype; return clearresource.perform_operation(client,"clear"); }
java
public static base_responses clear(nitro_service client, route6 resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { route6 clearresources[] = new route6[resources.length]; for (int i=0;i<resources.length;i++){ clearresources[i] = new route6(); clearresources[i].routetype = resources[i].routetype; } result = perform_operation_bulk_request(client, clearresources,"clear"); } return result; }
java
public static base_response delete(nitro_service client, String network) throws Exception { route6 deleteresource = new route6(); deleteresource.network = network; return deleteresource.delete_resource(client); }
java
public static base_response delete(nitro_service client, route6 resource) throws Exception { route6 deleteresource = new route6(); deleteresource.network = resource.network; deleteresource.gateway = resource.gateway; deleteresource.vlan = resource.vlan; deleteresource.td = resource.td; return deleteresource.delete_resource(client); }
java
public static base_responses delete(nitro_service client, String network[]) throws Exception { base_responses result = null; if (network != null && network.length > 0) { route6 deleteresources[] = new route6[network.length]; for (int i=0;i<network.length;i++){ deleteresources[i] = new route6(); deleteresources[i].network = network[i]; } result = delete_bulk_request(client, deleteresources); } return result; }
java
public static base_responses delete(nitro_service client, route6 resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { route6 deleteresources[] = new route6[resources.length]; for (int i=0;i<resources.length;i++){ deleteresources[i] = new route6(); deleteresources[i].network = resources[i].network; deleteresources[i].gateway = resources[i].gateway; deleteresources[i].vlan = resources[i].vlan; deleteresources[i].td = resources[i].td; } result = delete_bulk_request(client, deleteresources); } return result; }
java
public static base_response update(nitro_service client, route6 resource) throws Exception { route6 updateresource = new route6(); updateresource.network = resource.network; updateresource.gateway = resource.gateway; updateresource.vlan = resource.vlan; updateresource.weight = resource.weight; updateresource.distance = resource.distance; updateresource.cost = resource.cost; updateresource.advertise = resource.advertise; updateresource.msr = resource.msr; updateresource.monitor = resource.monitor; updateresource.td = resource.td; return updateresource.update_resource(client); }
java
public static base_responses update(nitro_service client, route6 resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { route6 updateresources[] = new route6[resources.length]; for (int i=0;i<resources.length;i++){ updateresources[i] = new route6(); updateresources[i].network = resources[i].network; updateresources[i].gateway = resources[i].gateway; updateresources[i].vlan = resources[i].vlan; updateresources[i].weight = resources[i].weight; updateresources[i].distance = resources[i].distance; updateresources[i].cost = resources[i].cost; updateresources[i].advertise = resources[i].advertise; updateresources[i].msr = resources[i].msr; updateresources[i].monitor = resources[i].monitor; updateresources[i].td = resources[i].td; } result = update_bulk_request(client, updateresources); } return result; }
java
public static route6[] get(nitro_service service) throws Exception{ route6 obj = new route6(); route6[] response = (route6[])obj.get_resources(service); return response; }
java
public static route6[] get(nitro_service service, route6_args args) throws Exception{ route6 obj = new route6(); options option = new options(); option.set_args(nitro_util.object_to_string_withoutquotes(args)); route6[] response = (route6[])obj.get_resources(service, option); return response; }
java
public static auditsyslogpolicy_vpnglobal_binding[] get(nitro_service service, String name) throws Exception{ auditsyslogpolicy_vpnglobal_binding obj = new auditsyslogpolicy_vpnglobal_binding(); obj.set_name(name); auditsyslogpolicy_vpnglobal_binding response[] = (auditsyslogpolicy_vpnglobal_binding[]) obj.get_resources(service); return response; }
java
public void addWord(MtasCQLParserWordFullCondition w) throws ParseException { assert w.getCondition() .not() == false : "condition word should be positive in sentence definition"; if (!simplified) { partList.add(w); } else { throw new ParseException("already simplified"); } }
java
public void addBasicSentence(MtasCQLParserBasicSentenceCondition s) throws ParseException { if (!simplified) { List<MtasCQLParserBasicSentencePartCondition> newWordList = s .getPartList(); partList.addAll(newWordList); } else { throw new ParseException("already simplified"); } }
java
public void setOccurence(int min, int max) throws ParseException { if (!simplified) { if ((min < 0) || (min > max) || (max < 1)) { throw new ParseException("Illegal number {" + min + "," + max + "}"); } if (min == 0) { optional = true; } minimumOccurence = Math.max(1, min); maximumOccurence = max; } else { throw new ParseException("already simplified"); } }
java
public static base_response add(nitro_service client, nspbr6 resource) throws Exception { nspbr6 addresource = new nspbr6(); addresource.name = resource.name; addresource.td = resource.td; addresource.action = resource.action; addresource.srcipv6 = resource.srcipv6; addresource.srcipop = resource.srcipop; addresource.srcipv6val = resource.srcipv6val; addresource.srcport = resource.srcport; addresource.srcportop = resource.srcportop; addresource.srcportval = resource.srcportval; addresource.destipv6 = resource.destipv6; addresource.destipop = resource.destipop; addresource.destipv6val = resource.destipv6val; addresource.destport = resource.destport; addresource.destportop = resource.destportop; addresource.destportval = resource.destportval; addresource.srcmac = resource.srcmac; addresource.protocol = resource.protocol; addresource.protocolnumber = resource.protocolnumber; addresource.vlan = resource.vlan; addresource.Interface = resource.Interface; addresource.priority = resource.priority; addresource.state = resource.state; addresource.msr = resource.msr; addresource.monitor = resource.monitor; addresource.nexthop = resource.nexthop; addresource.nexthopval = resource.nexthopval; addresource.nexthopvlan = resource.nexthopvlan; return addresource.add_resource(client); }
java
public static base_responses add(nitro_service client, nspbr6 resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { nspbr6 addresources[] = new nspbr6[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new nspbr6(); addresources[i].name = resources[i].name; addresources[i].td = resources[i].td; addresources[i].action = resources[i].action; addresources[i].srcipv6 = resources[i].srcipv6; addresources[i].srcipop = resources[i].srcipop; addresources[i].srcipv6val = resources[i].srcipv6val; addresources[i].srcport = resources[i].srcport; addresources[i].srcportop = resources[i].srcportop; addresources[i].srcportval = resources[i].srcportval; addresources[i].destipv6 = resources[i].destipv6; addresources[i].destipop = resources[i].destipop; addresources[i].destipv6val = resources[i].destipv6val; addresources[i].destport = resources[i].destport; addresources[i].destportop = resources[i].destportop; addresources[i].destportval = resources[i].destportval; addresources[i].srcmac = resources[i].srcmac; addresources[i].protocol = resources[i].protocol; addresources[i].protocolnumber = resources[i].protocolnumber; addresources[i].vlan = resources[i].vlan; addresources[i].Interface = resources[i].Interface; addresources[i].priority = resources[i].priority; addresources[i].state = resources[i].state; addresources[i].msr = resources[i].msr; addresources[i].monitor = resources[i].monitor; addresources[i].nexthop = resources[i].nexthop; addresources[i].nexthopval = resources[i].nexthopval; addresources[i].nexthopvlan = resources[i].nexthopvlan; } result = add_bulk_request(client, addresources); } return result; }
java
public static base_response renumber(nitro_service client) throws Exception { nspbr6 renumberresource = new nspbr6(); return renumberresource.perform_operation(client,"renumber"); }
java
public static base_responses renumber(nitro_service client, nspbr6 resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { nspbr6 renumberresources[] = new nspbr6[resources.length]; for (int i=0;i<resources.length;i++){ renumberresources[i] = new nspbr6(); } result = perform_operation_bulk_request(client, renumberresources,"renumber"); } return result; }
java
public static base_response update(nitro_service client, nspbr6 resource) throws Exception { nspbr6 updateresource = new nspbr6(); updateresource.name = resource.name; updateresource.action = resource.action; updateresource.srcipv6 = resource.srcipv6; updateresource.srcipop = resource.srcipop; updateresource.srcipv6val = resource.srcipv6val; updateresource.srcport = resource.srcport; updateresource.srcportop = resource.srcportop; updateresource.srcportval = resource.srcportval; updateresource.destipv6 = resource.destipv6; updateresource.destipop = resource.destipop; updateresource.destipv6val = resource.destipv6val; updateresource.destport = resource.destport; updateresource.destportop = resource.destportop; updateresource.destportval = resource.destportval; updateresource.srcmac = resource.srcmac; updateresource.protocol = resource.protocol; updateresource.protocolnumber = resource.protocolnumber; updateresource.vlan = resource.vlan; updateresource.Interface = resource.Interface; updateresource.priority = resource.priority; updateresource.msr = resource.msr; updateresource.monitor = resource.monitor; updateresource.nexthop = resource.nexthop; updateresource.nexthopval = resource.nexthopval; updateresource.nexthopvlan = resource.nexthopvlan; return updateresource.update_resource(client); }
java
public static base_responses update(nitro_service client, nspbr6 resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { nspbr6 updateresources[] = new nspbr6[resources.length]; for (int i=0;i<resources.length;i++){ updateresources[i] = new nspbr6(); updateresources[i].name = resources[i].name; updateresources[i].action = resources[i].action; updateresources[i].srcipv6 = resources[i].srcipv6; updateresources[i].srcipop = resources[i].srcipop; updateresources[i].srcipv6val = resources[i].srcipv6val; updateresources[i].srcport = resources[i].srcport; updateresources[i].srcportop = resources[i].srcportop; updateresources[i].srcportval = resources[i].srcportval; updateresources[i].destipv6 = resources[i].destipv6; updateresources[i].destipop = resources[i].destipop; updateresources[i].destipv6val = resources[i].destipv6val; updateresources[i].destport = resources[i].destport; updateresources[i].destportop = resources[i].destportop; updateresources[i].destportval = resources[i].destportval; updateresources[i].srcmac = resources[i].srcmac; updateresources[i].protocol = resources[i].protocol; updateresources[i].protocolnumber = resources[i].protocolnumber; updateresources[i].vlan = resources[i].vlan; updateresources[i].Interface = resources[i].Interface; updateresources[i].priority = resources[i].priority; updateresources[i].msr = resources[i].msr; updateresources[i].monitor = resources[i].monitor; updateresources[i].nexthop = resources[i].nexthop; updateresources[i].nexthopval = resources[i].nexthopval; updateresources[i].nexthopvlan = resources[i].nexthopvlan; } result = update_bulk_request(client, updateresources); } return result; }
java
public static base_response clear(nitro_service client) throws Exception { nspbr6 clearresource = new nspbr6(); return clearresource.perform_operation(client,"clear"); }
java
public static base_response apply(nitro_service client) throws Exception { nspbr6 applyresource = new nspbr6(); return applyresource.perform_operation(client,"apply"); }
java
public static base_responses apply(nitro_service client, nspbr6 resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { nspbr6 applyresources[] = new nspbr6[resources.length]; for (int i=0;i<resources.length;i++){ applyresources[i] = new nspbr6(); } result = perform_operation_bulk_request(client, applyresources,"apply"); } return result; }
java
public static nspbr6[] get(nitro_service service) throws Exception{ nspbr6 obj = new nspbr6(); nspbr6[] response = (nspbr6[])obj.get_resources(service); return response; }
java
public static nspbr6[] get(nitro_service service, nspbr6_args args) throws Exception{ nspbr6 obj = new nspbr6(); options option = new options(); option.set_args(nitro_util.object_to_string_withoutquotes(args)); nspbr6[] response = (nspbr6[])obj.get_resources(service, option); return response; }
java
public static nspbr6 get(nitro_service service, String name) throws Exception{ nspbr6 obj = new nspbr6(); obj.set_name(name); nspbr6 response = (nspbr6) obj.get_resource(service); return response; }
java
public static spilloverpolicy_stats[] get(nitro_service service) throws Exception{ spilloverpolicy_stats obj = new spilloverpolicy_stats(); spilloverpolicy_stats[] response = (spilloverpolicy_stats[])obj.stat_resources(service); return response; }
java
public static spilloverpolicy_stats get(nitro_service service, String name) throws Exception{ spilloverpolicy_stats obj = new spilloverpolicy_stats(); obj.set_name(name); spilloverpolicy_stats response = (spilloverpolicy_stats) obj.stat_resource(service); return response; }
java
public static appfwprofile_xmlvalidationurl_binding[] get(nitro_service service, String name) throws Exception{ appfwprofile_xmlvalidationurl_binding obj = new appfwprofile_xmlvalidationurl_binding(); obj.set_name(name); appfwprofile_xmlvalidationurl_binding response[] = (appfwprofile_xmlvalidationurl_binding[]) obj.get_resources(service); return response; }
java
public static vpnvserver_responderpolicy_binding[] get(nitro_service service, String name) throws Exception{ vpnvserver_responderpolicy_binding obj = new vpnvserver_responderpolicy_binding(); obj.set_name(name); vpnvserver_responderpolicy_binding response[] = (vpnvserver_responderpolicy_binding[]) obj.get_resources(service); return response; }
java
public static base_response add(nitro_service client, responderpolicy resource) throws Exception { responderpolicy addresource = new responderpolicy(); addresource.name = resource.name; addresource.rule = resource.rule; addresource.action = resource.action; addresource.undefaction = resource.undefaction; addresource.comment = resource.comment; addresource.logaction = resource.logaction; addresource.appflowaction = resource.appflowaction; return addresource.add_resource(client); }
java
public static base_response update(nitro_service client, responderpolicy resource) throws Exception { responderpolicy updateresource = new responderpolicy(); updateresource.name = resource.name; updateresource.rule = resource.rule; updateresource.action = resource.action; updateresource.undefaction = resource.undefaction; updateresource.comment = resource.comment; updateresource.logaction = resource.logaction; updateresource.appflowaction = resource.appflowaction; return updateresource.update_resource(client); }
java
public static base_responses update(nitro_service client, responderpolicy resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { responderpolicy updateresources[] = new responderpolicy[resources.length]; for (int i=0;i<resources.length;i++){ updateresources[i] = new responderpolicy(); updateresources[i].name = resources[i].name; updateresources[i].rule = resources[i].rule; updateresources[i].action = resources[i].action; updateresources[i].undefaction = resources[i].undefaction; updateresources[i].comment = resources[i].comment; updateresources[i].logaction = resources[i].logaction; updateresources[i].appflowaction = resources[i].appflowaction; } result = update_bulk_request(client, updateresources); } return result; }
java
public static base_response unset(nitro_service client, responderpolicy resource, String[] args) throws Exception{ responderpolicy unsetresource = new responderpolicy(); unsetresource.name = resource.name; return unsetresource.unset_resource(client,args); }
java
public static base_response rename(nitro_service client, responderpolicy resource, String new_name) throws Exception { responderpolicy renameresource = new responderpolicy(); renameresource.name = resource.name; return renameresource.rename_resource(client,new_name); }
java
public static responderpolicy[] get(nitro_service service) throws Exception{ responderpolicy obj = new responderpolicy(); responderpolicy[] response = (responderpolicy[])obj.get_resources(service); return response; }
java
public static responderpolicy get(nitro_service service, String name) throws Exception{ responderpolicy obj = new responderpolicy(); obj.set_name(name); responderpolicy response = (responderpolicy) obj.get_resource(service); return response; }
java
public static hanode_routemonitor6_binding[] get(nitro_service service, Long id) throws Exception{ hanode_routemonitor6_binding obj = new hanode_routemonitor6_binding(); obj.set_id(id); hanode_routemonitor6_binding response[] = (hanode_routemonitor6_binding[]) obj.get_resources(service); return response; }
java
public HashMap<String, IndexInput> getIndexInputList() { HashMap<String, IndexInput> clonedIndexInputList = new HashMap<String, IndexInput>(); for (Entry<String, IndexInput> entry : indexInputList.entrySet()) { clonedIndexInputList.put(entry.getKey(), entry.getValue().clone()); } return clonedIndexInputList; }
java
public static base_response delete(nitro_service client, systementitydata resource) throws Exception { systementitydata deleteresource = new systementitydata(); deleteresource.type = resource.type; deleteresource.name = resource.name; deleteresource.alldeleted = resource.alldeleted; deleteresource.allinactive = resource.allinactive; deleteresource.datasource = resource.datasource; deleteresource.core = resource.core; return deleteresource.delete_resource(client); }
java
public static systementitydata[] get(nitro_service service, systementitydata_args args) throws Exception{ systementitydata obj = new systementitydata(); options option = new options(); option.set_args(nitro_util.object_to_string_withoutquotes(args)); systementitydata[] response = (systementitydata[])obj.get_resources(service, option); return response; }
java
public static dos_stats get(nitro_service service, options option) throws Exception{ dos_stats obj = new dos_stats(); dos_stats[] response = (dos_stats[])obj.stat_resources(service,option); return response[0]; }
java
public static base_response add(nitro_service client, linkset resource) throws Exception { linkset addresource = new linkset(); addresource.id = resource.id; return addresource.add_resource(client); }
java
public static base_response delete(nitro_service client, String id) throws Exception { linkset deleteresource = new linkset(); deleteresource.id = id; return deleteresource.delete_resource(client); }
java
public static linkset[] get(nitro_service service) throws Exception{ linkset obj = new linkset(); linkset[] response = (linkset[])obj.get_resources(service); return response; }
java
public static linkset get(nitro_service service, String id) throws Exception{ linkset obj = new linkset(); obj.set_id(id); linkset response = (linkset) obj.get_resource(service); return response; }
java
public static nsrollbackcmd get(nitro_service service) throws Exception{ nsrollbackcmd obj = new nsrollbackcmd(); nsrollbackcmd[] response = (nsrollbackcmd[])obj.get_resources(service); return response[0]; }
java
public static nsrollbackcmd[] get(nitro_service service, nsrollbackcmd_args args) throws Exception{ nsrollbackcmd obj = new nsrollbackcmd(); options option = new options(); option.set_args(nitro_util.object_to_string_withoutquotes(args)); nsrollbackcmd[] response = (nsrollbackcmd[])obj.get_resources(service, option); return response; }
java
private int getPositiveInteger(String number) { try { return Math.max(0, Integer.parseInt(number)); } catch (NumberFormatException e) { return 0; } }
java
public static cachepolicylabel_binding get(nitro_service service, String labelname) throws Exception{ cachepolicylabel_binding obj = new cachepolicylabel_binding(); obj.set_labelname(labelname); cachepolicylabel_binding response = (cachepolicylabel_binding) obj.get_resource(service); return response; }
java
public static sslvserver_sslciphersuite_binding[] get(nitro_service service, String vservername) throws Exception{ sslvserver_sslciphersuite_binding obj = new sslvserver_sslciphersuite_binding(); obj.set_vservername(vservername); sslvserver_sslciphersuite_binding response[] = (sslvserver_sslciphersuite_binding[]) obj.get_resources(service); return response; }
java
public static long count(nitro_service service, String vservername) throws Exception{ sslvserver_sslciphersuite_binding obj = new sslvserver_sslciphersuite_binding(); obj.set_vservername(vservername); options option = new options(); option.set_count(true); sslvserver_sslciphersuite_binding response[] = (sslvserver_sslciphersuite_binding[]) obj.get_resources(service,option); if (response != null) { return response[0].__count; } return 0; }
java
public static base_response add(nitro_service client, nssimpleacl resource) throws Exception { nssimpleacl addresource = new nssimpleacl(); addresource.aclname = resource.aclname; addresource.aclaction = resource.aclaction; addresource.td = resource.td; addresource.srcip = resource.srcip; addresource.destport = resource.destport; addresource.protocol = resource.protocol; addresource.ttl = resource.ttl; return addresource.add_resource(client); }
java
public static base_response clear(nitro_service client) throws Exception { nssimpleacl clearresource = new nssimpleacl(); return clearresource.perform_operation(client,"clear"); }
java
public static base_response delete(nitro_service client, nssimpleacl resource) throws Exception { nssimpleacl deleteresource = new nssimpleacl(); deleteresource.aclname = resource.aclname; return deleteresource.delete_resource(client); }
java
public static base_response flush(nitro_service client, nssimpleacl resource) throws Exception { nssimpleacl flushresource = new nssimpleacl(); flushresource.estsessions = resource.estsessions; return flushresource.perform_operation(client,"flush"); }
java
public static nssimpleacl[] get(nitro_service service) throws Exception{ nssimpleacl obj = new nssimpleacl(); nssimpleacl[] response = (nssimpleacl[])obj.get_resources(service); return response; }
java
public static nssimpleacl get(nitro_service service, String aclname) throws Exception{ nssimpleacl obj = new nssimpleacl(); obj.set_aclname(aclname); nssimpleacl response = (nssimpleacl) obj.get_resource(service); return response; }
java
public static nssimpleacl[] get(nitro_service service, String aclname[]) throws Exception{ if (aclname !=null && aclname.length>0) { nssimpleacl response[] = new nssimpleacl[aclname.length]; nssimpleacl obj[] = new nssimpleacl[aclname.length]; for (int i=0;i<aclname.length;i++) { obj[i] = new nssimpleacl(); obj[i].set_aclname(aclname[i]); response[i] = (nssimpleacl) obj[i].get_resource(service); } return response; } return null; }
java
public static base_response update(nitro_service client, nstimeout resource) throws Exception { nstimeout updateresource = new nstimeout(); updateresource.zombie = resource.zombie; updateresource.client = resource.client; updateresource.server = resource.server; updateresource.httpclient = resource.httpclient; updateresource.httpserver = resource.httpserver; updateresource.tcpclient = resource.tcpclient; updateresource.tcpserver = resource.tcpserver; updateresource.anyclient = resource.anyclient; updateresource.anyserver = resource.anyserver; updateresource.halfclose = resource.halfclose; updateresource.nontcpzombie = resource.nontcpzombie; updateresource.reducedfintimeout = resource.reducedfintimeout; updateresource.newconnidletimeout = resource.newconnidletimeout; return updateresource.update_resource(client); }
java
public static base_response unset(nitro_service client, nstimeout resource, String[] args) throws Exception{ nstimeout unsetresource = new nstimeout(); return unsetresource.unset_resource(client,args); }
java
public static nstimeout get(nitro_service service) throws Exception{ nstimeout obj = new nstimeout(); nstimeout[] response = (nstimeout[])obj.get_resources(service); return response[0]; }
java
private Map<String, Entry> readEntries(String mapping, boolean ignoreCase) { Map<String, Entry> entries = new HashMap<>(); try { // ms, 2010-10-05: try to load the file from the CLASSPATH first InputStream is = getClass().getClassLoader().getResourceAsStream(mapping); // if not found in the CLASSPATH, load from the file system if (is == null) is = new FileInputStream(mapping); BufferedReader rd = new BufferedReader(new InputStreamReader(is)); int lineCount = 0; for (String line; (line = rd.readLine()) != null; ) { lineCount ++; String[] split = line.split("\t"); if (split.length < 2 || split.length > 4) throw new RuntimeException("Provided mapping file is in wrong format"); if (split[1].trim().equalsIgnoreCase("AS")) System.err.println("ERRRR " + mapping + "|" + line + " at " + lineCount); String stringLine = split[1].trim(); if (ignoreCase) stringLine = stringLine.toLowerCase(); String[] words = stringLine.split("\\s+"); String type = split[0].trim(); Set<String> overwritableTypes = new HashSet<String>(); overwritableTypes.add(flags.backgroundSymbol); overwritableTypes.add(null); double priority = 0; List<String> tokens = new ArrayList<String>(); try { if (split.length >= 3) overwritableTypes.addAll(Arrays.asList(split[2].trim().split(","))); if (split.length == 4) priority = Double.parseDouble(split[3].trim()); for (String str : words) { tokens.add(str); } } catch(NumberFormatException e) { System.err.println("ERROR: Invalid line " + lineCount + " in regexner file " + mapping + ": \"" + line + "\"!"); throw e; } addEntry(words, type, priority, overwritableTypes); } rd.close(); is.close(); } catch (IOException e) { e.printStackTrace(); } return entries; }
java
@Override public <VALUEBASE, VALUE extends VALUEBASE, KEY extends Key<CoreMap, VALUEBASE>> VALUE set(Class<KEY> key, VALUE value) { if (immutableKeys.contains(key)) { throw new HashableCoreMapException("Attempt to change value " + "of immutable field "+key.getSimpleName()); } return super.set(key, value); }
java