code
stringlengths 73
34.1k
| label
stringclasses 1
value |
---|---|
public static base_response update(nitro_service client, vpnurl resource) throws Exception {
vpnurl updateresource = new vpnurl();
updateresource.urlname = resource.urlname;
updateresource.linkname = resource.linkname;
updateresource.actualurl = resource.actualurl;
updateresource.clientlessaccess = resource.clientlessaccess;
updateresource.comment = resource.comment;
return updateresource.update_resource(client);
} | java |
public static base_responses update(nitro_service client, vpnurl resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
vpnurl updateresources[] = new vpnurl[resources.length];
for (int i=0;i<resources.length;i++){
updateresources[i] = new vpnurl();
updateresources[i].urlname = resources[i].urlname;
updateresources[i].linkname = resources[i].linkname;
updateresources[i].actualurl = resources[i].actualurl;
updateresources[i].clientlessaccess = resources[i].clientlessaccess;
updateresources[i].comment = resources[i].comment;
}
result = update_bulk_request(client, updateresources);
}
return result;
} | java |
public static base_response unset(nitro_service client, vpnurl resource, String[] args) throws Exception{
vpnurl unsetresource = new vpnurl();
unsetresource.urlname = resource.urlname;
return unsetresource.unset_resource(client,args);
} | java |
public static base_responses unset(nitro_service client, String urlname[], String args[]) throws Exception {
base_responses result = null;
if (urlname != null && urlname.length > 0) {
vpnurl unsetresources[] = new vpnurl[urlname.length];
for (int i=0;i<urlname.length;i++){
unsetresources[i] = new vpnurl();
unsetresources[i].urlname = urlname[i];
}
result = unset_bulk_request(client, unsetresources,args);
}
return result;
} | java |
public static vpnurl[] get(nitro_service service) throws Exception{
vpnurl obj = new vpnurl();
vpnurl[] response = (vpnurl[])obj.get_resources(service);
return response;
} | java |
public static vpnurl get(nitro_service service, String urlname) throws Exception{
vpnurl obj = new vpnurl();
obj.set_urlname(urlname);
vpnurl response = (vpnurl) obj.get_resource(service);
return response;
} | java |
public static vpnurl[] get(nitro_service service, String urlname[]) throws Exception{
if (urlname !=null && urlname.length>0) {
vpnurl response[] = new vpnurl[urlname.length];
vpnurl obj[] = new vpnurl[urlname.length];
for (int i=0;i<urlname.length;i++) {
obj[i] = new vpnurl();
obj[i].set_urlname(urlname[i]);
response[i] = (vpnurl) obj[i].get_resource(service);
}
return response;
}
return null;
} | java |
public Iterator<IntTaggedWord> ruleIteratorByWord(String word, int loc) {
return ruleIteratorByWord(wordIndex.indexOf(word, true), loc, null);
} | java |
public void addAll(List<TaggedWord> taggedWords, double weight) {
List<IntTaggedWord> tagWords = listToEvents(taggedWords);
} | java |
public final void train(Collection<Tree> trees, double weight) {
// scan data
for (Tree tree : trees) {
train(tree, weight);
}
} | java |
protected void addTagging(boolean seen, IntTaggedWord itw, double count) {
if (seen) {
seenCounter.incrementCount(itw, count);
if (itw.tag() == nullTag) {
words.add(itw);
} else if (itw.word() == nullWord) {
tags.add(itw);
} else {
// rules.add(itw);
}
} else {
uwModel.addTagging(seen, itw, count);
// if (itw.tag() == nullTag) {
// sigs.add(itw);
// }
}
} | java |
public void writeData(Writer w) throws IOException {
PrintWriter out = new PrintWriter(w);
for (IntTaggedWord itw : seenCounter.keySet()) {
out.println(itw.toLexicalEntry(wordIndex, tagIndex) + " SEEN " + seenCounter.getCount(itw));
}
for (IntTaggedWord itw : getUnknownWordModel().unSeenCounter().keySet()) {
out.println(itw.toLexicalEntry(wordIndex, tagIndex) + " UNSEEN " + getUnknownWordModel().unSeenCounter().getCount(itw));
}
for (int i = 0; i < smooth.length; i++) {
out.println("smooth[" + i + "] = " + smooth[i]);
}
out.flush();
} | java |
public static base_response add(nitro_service client, nd6 resource) throws Exception {
nd6 addresource = new nd6();
addresource.neighbor = resource.neighbor;
addresource.mac = resource.mac;
addresource.ifnum = resource.ifnum;
addresource.vlan = resource.vlan;
addresource.td = resource.td;
return addresource.add_resource(client);
} | java |
public static base_responses add(nitro_service client, nd6 resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
nd6 addresources[] = new nd6[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i] = new nd6();
addresources[i].neighbor = resources[i].neighbor;
addresources[i].mac = resources[i].mac;
addresources[i].ifnum = resources[i].ifnum;
addresources[i].vlan = resources[i].vlan;
addresources[i].td = resources[i].td;
}
result = add_bulk_request(client, addresources);
}
return result;
} | java |
public static base_response clear(nitro_service client) throws Exception {
nd6 clearresource = new nd6();
return clearresource.perform_operation(client,"clear");
} | java |
public static base_response delete(nitro_service client, String neighbor) throws Exception {
nd6 deleteresource = new nd6();
deleteresource.neighbor = neighbor;
return deleteresource.delete_resource(client);
} | java |
public static base_response delete(nitro_service client, nd6 resource) throws Exception {
nd6 deleteresource = new nd6();
deleteresource.neighbor = resource.neighbor;
deleteresource.vlan = resource.vlan;
deleteresource.td = resource.td;
return deleteresource.delete_resource(client);
} | java |
public static base_responses delete(nitro_service client, String neighbor[]) throws Exception {
base_responses result = null;
if (neighbor != null && neighbor.length > 0) {
nd6 deleteresources[] = new nd6[neighbor.length];
for (int i=0;i<neighbor.length;i++){
deleteresources[i] = new nd6();
deleteresources[i].neighbor = neighbor[i];
}
result = delete_bulk_request(client, deleteresources);
}
return result;
} | java |
public static nd6[] get(nitro_service service) throws Exception{
nd6 obj = new nd6();
nd6[] response = (nd6[])obj.get_resources(service);
return response;
} | java |
public static csvserver_lbvserver_binding[] get(nitro_service service, String name) throws Exception{
csvserver_lbvserver_binding obj = new csvserver_lbvserver_binding();
obj.set_name(name);
csvserver_lbvserver_binding response[] = (csvserver_lbvserver_binding[]) obj.get_resources(service);
return response;
} | java |
public static streamidentifier_binding get(nitro_service service, String name) throws Exception{
streamidentifier_binding obj = new streamidentifier_binding();
obj.set_name(name);
streamidentifier_binding response = (streamidentifier_binding) obj.get_resource(service);
return response;
} | java |
public static appfwprofile_xmlxss_binding[] get(nitro_service service, String name) throws Exception{
appfwprofile_xmlxss_binding obj = new appfwprofile_xmlxss_binding();
obj.set_name(name);
appfwprofile_xmlxss_binding response[] = (appfwprofile_xmlxss_binding[]) obj.get_resources(service);
return response;
} | java |
public static authenticationlocalpolicy_binding get(nitro_service service, String name) throws Exception{
authenticationlocalpolicy_binding obj = new authenticationlocalpolicy_binding();
obj.set_name(name);
authenticationlocalpolicy_binding response = (authenticationlocalpolicy_binding) obj.get_resource(service);
return response;
} | java |
public static dnspolicy64_lbvserver_binding[] get(nitro_service service, String name) throws Exception{
dnspolicy64_lbvserver_binding obj = new dnspolicy64_lbvserver_binding();
obj.set_name(name);
dnspolicy64_lbvserver_binding response[] = (dnspolicy64_lbvserver_binding[]) obj.get_resources(service);
return response;
} | java |
public static <E> double logSum(Counter<E> c) {
return ArrayMath.logSum(ArrayMath.unbox(c.values()));
} | java |
public static <E> double max(Counter<E> c) {
double max = Double.NEGATIVE_INFINITY;
for (double v : c.values()) {
max = Math.max(max, v);
}
return max;
} | java |
public static <E> Counter<E> asCounter(Collection<E> c) {
Counter<E> count = new ClassicCounter<E>();
for (E elem : c) {
count.incrementCount(elem);
}
return count;
} | java |
public static <E> double min(Counter<E> c) {
double min = Double.POSITIVE_INFINITY;
for (double v : c.values()) {
min = Math.min(min, v);
}
return min;
} | java |
public static <E> E argmax(Counter<E> c) {
double max = Double.NEGATIVE_INFINITY;
E argmax = null;
for (E key : c.keySet()) {
double count = c.getCount(key);
if (argmax == null || count > max) {// || (count == max &&
// tieBreaker.compare(key, argmax) <
// 0)) {
max = count;
argmax = key;
}
}
return argmax;
} | java |
public static <E> E argmin(Counter<E> c) {
double min = Double.POSITIVE_INFINITY;
E argmin = null;
for (E key : c.keySet()) {
double count = c.getCount(key);
if (argmin == null || count < min) {// || (count == min &&
// tieBreaker.compare(key, argmin) <
// 0)) {
min = count;
argmin = key;
}
}
return argmin;
} | java |
public static <E> void addInPlace(Counter<E> target, double value) {
for (E key : target.keySet()) {
target.incrementCount(key, value);
}
} | java |
public static <E> void divideInPlace(Counter<E> target, Counter<E> denominator) {
for (E key : target.keySet()) {
target.setCount(key, target.getCount(key) / denominator.getCount(key));
}
} | java |
public static <E> void dotProductInPlace(Counter<E> target, Counter<E> term) {
for (E key : target.keySet()) {
target.setCount(key, target.getCount(key) * term.getCount(key));
}
} | java |
public static <E> Counter<E> divideInPlace(Counter<E> target, double divisor) {
for (Entry<E, Double> entry : target.entrySet()) {
target.setCount(entry.getKey(), entry.getValue() / divisor);
}
return target;
} | java |
public static <E> Counter<E> multiplyInPlace(Counter<E> target, double multiplier) {
for (Entry<E, Double> entry : target.entrySet()) {
target.setCount(entry.getKey(), entry.getValue() * multiplier);
}
return target;
} | java |
public static <E> List<E> deleteOutofRange(Counter<E> c, int top, int bottom) {
List<E> purgedItems = new ArrayList<E>();
int numToPurge = top + bottom;
if (numToPurge <= 0) {
return purgedItems;
}
List<E> l = Counters.toSortedList(c);
for (int i = 0; i < top; i++) {
E item = l.get(i);
purgedItems.add(item);
c.remove(item);
}
int size = c.size();
for (int i = c.size() - 1; i >= (size - bottom); i--) {
E item = l.get(i);
purgedItems.add(item);
c.remove(item);
}
return purgedItems;
} | java |
public static <E> Set<E> retainNonZeros(Counter<E> counter) {
Set<E> removed = new HashSet<E>();
for (E key : counter.keySet()) {
if (counter.getCount(key) == 0.0) {
removed.add(key);
}
}
for (E key : removed) {
counter.remove(key);
}
return removed;
} | java |
public static <E> Set<E> retainAbove(Counter<E> counter, double countThreshold) {
Set<E> removed = new HashSet<E>();
for (E key : counter.keySet()) {
if (counter.getCount(key) < countThreshold) {
removed.add(key);
}
}
for (E key : removed) {
counter.remove(key);
}
return removed;
} | java |
public static <E> Set<E> retainBelow(Counter<E> counter, double countMaxThreshold) {
Set<E> removed = new HashSet<E>();
for (E key : counter.keySet()) {
if (counter.getCount(key) > countMaxThreshold) {
removed.add(key);
}
}
for (E key : removed) {
counter.remove(key);
}
return removed;
} | java |
public static Set<String> retainMatchingKeys(Counter<String> counter, List<Pattern> matchPatterns) {
Set<String> removed = new HashSet<String>();
for (String key : counter.keySet()) {
boolean matched = false;
for (Pattern pattern : matchPatterns) {
if (pattern.matcher(key).matches()) {
matched = true;
break;
}
}
if (!matched) {
removed.add(key);
}
}
for (String key : removed) {
counter.remove(key);
}
return removed;
} | java |
public static<E> Set<E> retainKeys(Counter<E> counter, Collection<E> matchKeys) {
Set<E> removed = new HashSet<E>();
for (E key : counter.keySet()) {
boolean matched = matchKeys.contains(key);
if (!matched) {
removed.add(key);
}
}
for (E key : removed) {
counter.remove(key);
}
return removed;
} | java |
public static <E> void removeKeys(Counter<E> counter, Collection<E> removeKeysCollection) {
for (E key : removeKeysCollection)
counter.remove(key);
} | java |
public static <T1, T2> Counter<T2> transform(Counter<T1> c, Function<T1, T2> f) {
Counter<T2> c2 = new ClassicCounter<T2>();
for (T1 key : c.keySet()) {
c2.setCount(f.apply(key), c.getCount(key));
}
return c2;
} | java |
public static <E> IntCounter<E> toRankCounter(Counter<E> c) {
IntCounter<E> rankCounter = new IntCounter<E>();
List<E> sortedList = toSortedList(c);
for (int i = 0; i < sortedList.size(); i++) {
rankCounter.setCount(sortedList.get(i), i);
}
return rankCounter;
} | java |
public static <E> List<Pair<E, Double>> toSortedListWithCounts(Counter<E> c) {
List<Pair<E, Double>> l = new ArrayList<Pair<E, Double>>(c.size());
for (E e : c.keySet()) {
l.add(new Pair<E, Double>(e, c.getCount(e)));
}
// descending order
Collections.sort(l, new Comparator<Pair<E, Double>>() {
public int compare(Pair<E, Double> a, Pair<E, Double> b) {
return Double.compare(b.second, a.second);
}
});
return l;
} | java |
public static <E> Counter<E> intersection(Counter<E> c1, Counter<E> c2) {
Counter<E> result = c1.getFactory().create();
for (E key : Sets.union(c1.keySet(), c2.keySet())) {
double count1 = c1.getCount(key);
double count2 = c2.getCount(key);
double minCount = (count1 < count2 ? count1 : count2);
if (minCount > 0) {
result.setCount(key, minCount);
}
}
return result;
} | java |
public static <E> double optimizedDotProduct(Counter<E> c1, Counter<E> c2) {
double dotProd = 0.0;
int size1 = c1.size();
int size2 = c2.size();
if (size1 < size2) {
for (E key : c1.keySet()) {
double count1 = c1.getCount(key);
if (count1 != 0.0) {
double count2 = c2.getCount(key);
if (count2 != 0.0)
dotProd += (count1 * count2);
}
}
} else {
for (E key : c2.keySet()) {
double count2 = c2.getCount(key);
if (count2 != 0.0) {
double count1 = c1.getCount(key);
if (count1 != 0.0)
dotProd += (count1 * count2);
}
}
}
return dotProd;
} | java |
public static <E> Counter<E> absoluteDifference(Counter<E> c1, Counter<E> c2) {
Counter<E> result = c1.getFactory().create();
for (E key : Sets.union(c1.keySet(), c2.keySet())) {
double newCount = Math.abs(c1.getCount(key) - c2.getCount(key));
if (newCount > 0) {
result.setCount(key, newCount);
}
}
return result;
} | java |
public static <E> Counter<E> division(Counter<E> c1, Counter<E> c2) {
Counter<E> result = c1.getFactory().create();
for (E key : Sets.union(c1.keySet(), c2.keySet())) {
result.setCount(key, c1.getCount(key) / c2.getCount(key));
}
return result;
} | java |
public static <E> double crossEntropy(Counter<E> from, Counter<E> to) {
double tot2 = to.totalCount();
double result = 0.0;
for (E key : from.keySet()) {
double count1 = from.getCount(key);
if (count1 == 0.0) {
continue;
}
double count2 = to.getCount(key);
double logFract = Math.log(count2 / tot2);
if (logFract == Double.NEGATIVE_INFINITY) {
return Double.NEGATIVE_INFINITY; // can't recover
}
result += count1 * (logFract / LOG_E_2); // express it in log base 2
}
return result;
} | java |
public static <E, C extends Counter<E>> C L2Normalize(C c) {
return scale(c, 1.0 / L2Norm(c));
} | java |
public static <E, C extends Counter<E>> Counter<E> L2NormalizeInPlace(Counter<E> c) {
return multiplyInPlace(c, 1.0 / L2Norm(c));
} | java |
public static <E, C extends Counter<E>> C saferL2Normalize(C c) {
return scale(c, 1.0 / saferL2Norm(c));
} | java |
public static <E> Counter<E> average(Counter<E> c1, Counter<E> c2) {
Counter<E> average = c1.getFactory().create();
Set<E> allKeys = new HashSet<E>(c1.keySet());
allKeys.addAll(c2.keySet());
for (E key : allKeys) {
average.setCount(key, (c1.getCount(key) + c2.getCount(key)) * 0.5);
}
return average;
} | java |
public static <E> Counter<E> linearCombination(Counter<E> c1, double w1, Counter<E> c2, double w2) {
Counter<E> result = c1.getFactory().create();
for (E o : c1.keySet()) {
result.incrementCount(o, c1.getCount(o) * w1);
}
for (E o : c2.keySet()) {
result.incrementCount(o, c2.getCount(o) * w2);
}
return result;
} | java |
@SuppressWarnings("unchecked")
public static <E, C extends Counter<E>> C scale(C c, double s) {
C scaled = (C) c.getFactory().create();
for (E key : c.keySet()) {
scaled.setCount(key, c.getCount(key) * s);
}
return scaled;
} | java |
@SuppressWarnings("unchecked")
public static <E, C extends Counter<E>> C tfLogScale(C c, double base) {
C scaled = (C) c.getFactory().create();
for (E key : c.keySet()) {
double cnt = c.getCount(key);
double scaledCnt = 0.0;
if (cnt > 0) {
scaledCnt = 1.0 + SloppyMath.log(cnt, base);
}
scaled.setCount(key, scaledCnt);
}
return scaled;
} | java |
private static <E> void loadIntoCounter(String filename, Class<E> c, Counter<E> counter) throws RuntimeException {
try {
Constructor<E> m = c.getConstructor(String.class);
BufferedReader in = IOUtils.getBufferedFileReader(filename);// new
// BufferedReader(new
// FileReader(filename));
String line = in.readLine();
while (line != null && line.length() > 0) {
int endPos = Math.max(line.lastIndexOf(' '), line.lastIndexOf('\t'));
counter.setCount(m.newInstance(line.substring(0, endPos).trim()), Double.parseDouble(line.substring(endPos, line.length()).trim()));
line = in.readLine();
}
in.close();
} catch (Exception e) {
throw new RuntimeException(e);
}
} | java |
public static <E> Counter<E> toCounter(Map<Integer, ? extends Number> counts, Index<E> index) {
Counter<E> counter = new ClassicCounter<E>();
for (Map.Entry<Integer, ? extends Number> entry : counts.entrySet()) {
counter.setCount(index.get(entry.getKey()), entry.getValue().doubleValue());
}
return counter;
} | java |
@SuppressWarnings("unchecked")
// This is not good code, but what's there to be done? TODO
public static <T> T sample(Counter<T> c, Random rand) {
Iterable<T> objects;
Set<T> keySet = c.keySet();
objects = c.keySet();
if (rand == null) {
rand = new Random();
} else { // TODO: Seems like there should be a way to directly check if T is
// comparable
if (!keySet.isEmpty() && keySet.iterator().next() instanceof Comparable) {
List l = new ArrayList<T>(keySet);
Collections.sort(l);
objects = l;
} else {
throw new RuntimeException("Results won't be stable since Counters keys are comparable.");
}
}
double r = rand.nextDouble() * c.totalCount();
double total = 0.0;
for (T t : objects) { // arbitrary ordering
total += c.getCount(t);
if (total >= r)
return t;
}
// only chance of reaching here is if c isn't properly normalized, or if
// double math makes total<1.0
return c.keySet().iterator().next();
} | java |
public static <E> Counter<E> powNormalized(Counter<E> c, double temp) {
Counter<E> d = c.getFactory().create();
double total = c.totalCount();
for (E e : c.keySet()) {
d.setCount(e, Math.pow(c.getCount(e) / total, temp));
}
return d;
} | java |
public static <E> Counter<E> asCounter(FixedPrioritiesPriorityQueue<E> p) {
FixedPrioritiesPriorityQueue<E> pq = p.clone();
ClassicCounter<E> counter = new ClassicCounter<E>();
while (pq.hasNext()) {
double priority = pq.getPriority();
E element = pq.next();
counter.incrementCount(element, priority);
}
return counter;
} | java |
public static <E> Map<E, Double> asMap(final Counter<E> counter) {
return new AbstractMap<E, Double>() {
@Override
public int size() {
return counter.size();
}
@Override
public Set<Entry<E, Double>> entrySet() {
return counter.entrySet();
}
@Override
@SuppressWarnings("unchecked")
public boolean containsKey(Object key) {
return counter.containsKey((E) key);
}
@Override
@SuppressWarnings("unchecked")
public Double get(Object key) {
return counter.getCount((E) key);
}
@Override
public Double put(E key, Double value) {
double last = counter.getCount(key);
counter.setCount(key, value);
return last;
}
@Override
@SuppressWarnings("unchecked")
public Double remove(Object key) {
return counter.remove((E) key);
}
@Override
public Set<E> keySet() {
return counter.keySet();
}
};
} | java |
public static appqoepolicy_binding get(nitro_service service, String name) throws Exception{
appqoepolicy_binding obj = new appqoepolicy_binding();
obj.set_name(name);
appqoepolicy_binding response = (appqoepolicy_binding) obj.get_resource(service);
return response;
} | java |
public static base_response add(nitro_service client, appfwxmlcontenttype resource) throws Exception {
appfwxmlcontenttype addresource = new appfwxmlcontenttype();
addresource.xmlcontenttypevalue = resource.xmlcontenttypevalue;
addresource.isregex = resource.isregex;
return addresource.add_resource(client);
} | java |
public static base_responses add(nitro_service client, appfwxmlcontenttype resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
appfwxmlcontenttype addresources[] = new appfwxmlcontenttype[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i] = new appfwxmlcontenttype();
addresources[i].xmlcontenttypevalue = resources[i].xmlcontenttypevalue;
addresources[i].isregex = resources[i].isregex;
}
result = add_bulk_request(client, addresources);
}
return result;
} | java |
public static base_response delete(nitro_service client, String xmlcontenttypevalue) throws Exception {
appfwxmlcontenttype deleteresource = new appfwxmlcontenttype();
deleteresource.xmlcontenttypevalue = xmlcontenttypevalue;
return deleteresource.delete_resource(client);
} | java |
public static base_responses delete(nitro_service client, String xmlcontenttypevalue[]) throws Exception {
base_responses result = null;
if (xmlcontenttypevalue != null && xmlcontenttypevalue.length > 0) {
appfwxmlcontenttype deleteresources[] = new appfwxmlcontenttype[xmlcontenttypevalue.length];
for (int i=0;i<xmlcontenttypevalue.length;i++){
deleteresources[i] = new appfwxmlcontenttype();
deleteresources[i].xmlcontenttypevalue = xmlcontenttypevalue[i];
}
result = delete_bulk_request(client, deleteresources);
}
return result;
} | java |
public static appfwxmlcontenttype[] get(nitro_service service) throws Exception{
appfwxmlcontenttype obj = new appfwxmlcontenttype();
appfwxmlcontenttype[] response = (appfwxmlcontenttype[])obj.get_resources(service);
return response;
} | java |
public static appfwxmlcontenttype get(nitro_service service, String xmlcontenttypevalue) throws Exception{
appfwxmlcontenttype obj = new appfwxmlcontenttype();
obj.set_xmlcontenttypevalue(xmlcontenttypevalue);
appfwxmlcontenttype response = (appfwxmlcontenttype) obj.get_resource(service);
return response;
} | java |
public static appfwxmlcontenttype[] get(nitro_service service, String xmlcontenttypevalue[]) throws Exception{
if (xmlcontenttypevalue !=null && xmlcontenttypevalue.length>0) {
appfwxmlcontenttype response[] = new appfwxmlcontenttype[xmlcontenttypevalue.length];
appfwxmlcontenttype obj[] = new appfwxmlcontenttype[xmlcontenttypevalue.length];
for (int i=0;i<xmlcontenttypevalue.length;i++) {
obj[i] = new appfwxmlcontenttype();
obj[i].set_xmlcontenttypevalue(xmlcontenttypevalue[i]);
response[i] = (appfwxmlcontenttype) obj[i].get_resource(service);
}
return response;
}
return null;
} | java |
public static base_response add(nitro_service client, policymap resource) throws Exception {
policymap addresource = new policymap();
addresource.mappolicyname = resource.mappolicyname;
addresource.sd = resource.sd;
addresource.su = resource.su;
addresource.td = resource.td;
addresource.tu = resource.tu;
return addresource.add_resource(client);
} | java |
public static base_responses add(nitro_service client, policymap resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
policymap addresources[] = new policymap[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i] = new policymap();
addresources[i].mappolicyname = resources[i].mappolicyname;
addresources[i].sd = resources[i].sd;
addresources[i].su = resources[i].su;
addresources[i].td = resources[i].td;
addresources[i].tu = resources[i].tu;
}
result = add_bulk_request(client, addresources);
}
return result;
} | java |
public static base_response delete(nitro_service client, String mappolicyname) throws Exception {
policymap deleteresource = new policymap();
deleteresource.mappolicyname = mappolicyname;
return deleteresource.delete_resource(client);
} | java |
public static base_responses delete(nitro_service client, String mappolicyname[]) throws Exception {
base_responses result = null;
if (mappolicyname != null && mappolicyname.length > 0) {
policymap deleteresources[] = new policymap[mappolicyname.length];
for (int i=0;i<mappolicyname.length;i++){
deleteresources[i] = new policymap();
deleteresources[i].mappolicyname = mappolicyname[i];
}
result = delete_bulk_request(client, deleteresources);
}
return result;
} | java |
public static policymap[] get(nitro_service service) throws Exception{
policymap obj = new policymap();
policymap[] response = (policymap[])obj.get_resources(service);
return response;
} | java |
public static policymap get(nitro_service service, String mappolicyname) throws Exception{
policymap obj = new policymap();
obj.set_mappolicyname(mappolicyname);
policymap response = (policymap) obj.get_resource(service);
return response;
} | java |
public static policymap[] get(nitro_service service, String mappolicyname[]) throws Exception{
if (mappolicyname !=null && mappolicyname.length>0) {
policymap response[] = new policymap[mappolicyname.length];
policymap obj[] = new policymap[mappolicyname.length];
for (int i=0;i<mappolicyname.length;i++) {
obj[i] = new policymap();
obj[i].set_mappolicyname(mappolicyname[i]);
response[i] = (policymap) obj[i].get_resource(service);
}
return response;
}
return null;
} | java |
public static base_response unset(nitro_service client, iptunnelparam resource, String[] args) throws Exception{
iptunnelparam unsetresource = new iptunnelparam();
return unsetresource.unset_resource(client,args);
} | java |
public static iptunnelparam get(nitro_service service) throws Exception{
iptunnelparam obj = new iptunnelparam();
iptunnelparam[] response = (iptunnelparam[])obj.get_resources(service);
return response[0];
} | java |
public static statobjects get(nitro_service service) throws Exception{
statobjects obj = new statobjects();
statobjects[] response = (statobjects[])obj.get_resources(service);
return response[0];
} | java |
public static lbmonitor_metric_binding[] get(nitro_service service, String monitorname) throws Exception{
lbmonitor_metric_binding obj = new lbmonitor_metric_binding();
obj.set_monitorname(monitorname);
lbmonitor_metric_binding response[] = (lbmonitor_metric_binding[]) obj.get_resources(service);
return response;
} | java |
public static long count(nitro_service service, String monitorname) throws Exception{
lbmonitor_metric_binding obj = new lbmonitor_metric_binding();
obj.set_monitorname(monitorname);
options option = new options();
option.set_count(true);
lbmonitor_metric_binding response[] = (lbmonitor_metric_binding[]) obj.get_resources(service,option);
if (response != null) {
return response[0].__count;
}
return 0;
} | java |
public static server_binding get(nitro_service service, String name) throws Exception{
server_binding obj = new server_binding();
obj.set_name(name);
server_binding response = (server_binding) obj.get_resource(service);
return response;
} | java |
public static base_response update(nitro_service client, aaacertparams resource) throws Exception {
aaacertparams updateresource = new aaacertparams();
updateresource.usernamefield = resource.usernamefield;
updateresource.groupnamefield = resource.groupnamefield;
updateresource.defaultauthenticationgroup = resource.defaultauthenticationgroup;
return updateresource.update_resource(client);
} | java |
public static base_response unset(nitro_service client, aaacertparams resource, String[] args) throws Exception{
aaacertparams unsetresource = new aaacertparams();
return unsetresource.unset_resource(client,args);
} | java |
public static aaacertparams get(nitro_service service) throws Exception{
aaacertparams obj = new aaacertparams();
aaacertparams[] response = (aaacertparams[])obj.get_resources(service);
return response[0];
} | java |
public static base_response add(nitro_service client, cmpaction resource) throws Exception {
cmpaction addresource = new cmpaction();
addresource.name = resource.name;
addresource.cmptype = resource.cmptype;
addresource.deltatype = resource.deltatype;
return addresource.add_resource(client);
} | java |
public static base_responses add(nitro_service client, cmpaction resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
cmpaction addresources[] = new cmpaction[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i] = new cmpaction();
addresources[i].name = resources[i].name;
addresources[i].cmptype = resources[i].cmptype;
addresources[i].deltatype = resources[i].deltatype;
}
result = add_bulk_request(client, addresources);
}
return result;
} | java |
public static cmpaction[] get(nitro_service service, options option) throws Exception{
cmpaction obj = new cmpaction();
cmpaction[] response = (cmpaction[])obj.get_resources(service,option);
return response;
} | java |
public static cmpaction get(nitro_service service, String name) throws Exception{
cmpaction obj = new cmpaction();
obj.set_name(name);
cmpaction response = (cmpaction) obj.get_resource(service);
return response;
} | java |
public static base_response delete(nitro_service client, String name) throws Exception {
netbridge deleteresource = new netbridge();
deleteresource.name = name;
return deleteresource.delete_resource(client);
} | java |
public static netbridge[] get(nitro_service service, options option) throws Exception{
netbridge obj = new netbridge();
netbridge[] response = (netbridge[])obj.get_resources(service,option);
return response;
} | java |
public static netbridge get(nitro_service service, String name) throws Exception{
netbridge obj = new netbridge();
obj.set_name(name);
netbridge response = (netbridge) obj.get_resource(service);
return response;
} | java |
public static base_response change(nitro_service client, nsaptlicense resource) throws Exception {
nsaptlicense updateresource = new nsaptlicense();
updateresource.id = resource.id;
updateresource.sessionid = resource.sessionid;
updateresource.bindtype = resource.bindtype;
updateresource.countavailable = resource.countavailable;
updateresource.licensedir = resource.licensedir;
return updateresource.perform_operation(client,"update");
} | java |
public static base_responses change(nitro_service client, nsaptlicense resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
nsaptlicense updateresources[] = new nsaptlicense[resources.length];
for (int i=0;i<resources.length;i++){
updateresources[i] = new nsaptlicense();
updateresources[i].id = resources[i].id;
updateresources[i].sessionid = resources[i].sessionid;
updateresources[i].bindtype = resources[i].bindtype;
updateresources[i].countavailable = resources[i].countavailable;
updateresources[i].licensedir = resources[i].licensedir;
}
result = perform_operation_bulk_request(client, updateresources,"update");
}
return result;
} | java |
public static nsaptlicense[] get(nitro_service service, nsaptlicense_args args) throws Exception{
nsaptlicense obj = new nsaptlicense();
options option = new options();
option.set_args(nitro_util.object_to_string_withoutquotes(args));
nsaptlicense[] response = (nsaptlicense[])obj.get_resources(service, option);
return response;
} | java |
public static cacheglobal_cachepolicy_binding[] get(nitro_service service) throws Exception{
cacheglobal_cachepolicy_binding obj = new cacheglobal_cachepolicy_binding();
cacheglobal_cachepolicy_binding response[] = (cacheglobal_cachepolicy_binding[]) obj.get_resources(service);
return response;
} | java |
public static responderpolicy_stats[] get(nitro_service service) throws Exception{
responderpolicy_stats obj = new responderpolicy_stats();
responderpolicy_stats[] response = (responderpolicy_stats[])obj.stat_resources(service);
return response;
} | java |
public static responderpolicy_stats get(nitro_service service, String name) throws Exception{
responderpolicy_stats obj = new responderpolicy_stats();
obj.set_name(name);
responderpolicy_stats response = (responderpolicy_stats) obj.stat_resource(service);
return response;
} | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.