_id stringlengths 2 7 | title stringlengths 3 140 | partition stringclasses 3
values | text stringlengths 73 34.1k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q12800 | base_resource.get_object_type | train | protected String get_object_type()
{
String name = this.getClass().getName();
int index = name.lastIndexOf(".");
if(index > 0)
name = name.substring(index+1);
index = name.lastIndexOf("_stats");
if (index > 0) {
name = name.substring(0, index);
}
return name;
} | java | {
"resource": ""
} |
q12801 | base_resource.unset_string | train | protected String unset_string(nitro_service service, String id, options option, String args[]) throws Exception
{
Boolean warning = service.get_warning();
String result = service.get_payload_formatter().unset_string(this, id, option, args, warning);
return result;
} | java | {
"resource": ""
} |
q12802 | base_resource.post_requestEx | train | private base_resource post_requestEx(nitro_service service, options option) throws Exception
{
String sessionid = service.get_sessionid();
String request = resource_to_string(service, sessionid, option);
return post_dataEx(service, request);
} | java | {
"resource": ""
} |
q12803 | base_resource.add_resource | train | protected base_response add_resource(nitro_service service,options option) throws Exception
{
if (!service.isLogin() && !this.get_object_type().equals("login"))
service.login();
String sessionid = service.get_sessionid();
String request = resource_to_string(service, sessionid, option);
return post_data(service,request);
} | java | {
"resource": ""
} |
q12804 | base_resource.update_resource | train | protected base_response update_resource(nitro_service service,options option) throws Exception
{
if (!service.isLogin() && !this.get_object_type().equals("login"))
service.login();
String sessionid = service.get_sessionid();
String request = resource_to_string(service, sessionid, option);
return put_data(service,request);
} | java | {
"resource": ""
} |
q12805 | base_resource.delete_resource | train | protected base_response delete_resource(nitro_service service) throws Exception
{
base_response response;
if (!service.isLogin())
service.login();
String str = nitro_util.object_to_string_withoutquotes(this);
response = delete_request(service, str);
return response;
} | java | {
"resource": ""
} |
q12806 | base_resource.getfiltered | train | protected base_resource[] getfiltered(nitro_service service,options option) throws Exception
{
if (!service.isLogin())
service.login();
base_resource[] response = get_request(service, option);
return response;
} | java | {
"resource": ""
} |
q12807 | base_resource.get_resource | train | protected base_resource get_resource(nitro_service service,options option) throws Exception
{
if (!service.isLogin())
service.login();
base_resource[] response = get_request(service, option);
if (response != null) {
return response[0];
}
return null;
} | java | {
"resource": ""
} |
q12808 | base_resource.stat_resources | train | protected base_resource[] stat_resources(nitro_service service,options option) throws Exception
{
if (!service.isLogin())
service.login();
base_resource[] response = stat_request(service, option);
return response;
} | java | {
"resource": ""
} |
q12809 | base_resource.stat_resource | train | protected base_resource stat_resource(nitro_service service,options option) throws Exception
{
if (!service.isLogin())
service.login();
base_resource[] response = stat_request(service, option);
if (response != null && response.length > 0)
{
return response[0];
}
return null;
} | java | {
"resource": ""
} |
q12810 | base_resource.perform_operationEx | train | public base_resource perform_operationEx(nitro_service service, String action) throws Exception
{
if (!service.isLogin() && !get_object_type().equals("login"))
service.login();
options option = new options();
option.set_action(action);
base_resource response = post_requestEx(service, option);
return response;
} | java | {
"resource": ""
} |
q12811 | base_resource.rename_resource | train | protected base_response rename_resource(nitro_service service, String newname) throws Exception
{
if (!service.isLogin() && !get_object_type().equals("login"))
service.login();
options option = new options();
option.set_action("rename");
this.set_newname(newname);
base_response response = post_request(service, option);
return response;
} | java | {
"resource": ""
} |
q12812 | base_resource.update_bulk_request | train | protected static base_responses update_bulk_request(nitro_service service,base_resource resources[]) throws Exception
{
if (!service.isLogin())
service.login();
String id = service.get_sessionid();
Boolean warning = service.get_warning();
String onerror = service.get_onerror();
String request = service.get_payload_formatter().resource_to_string(resources, id, null, warning, onerror);
base_responses result = put_bulk_data(service, request);
return result;
} | java | {
"resource": ""
} |
q12813 | base_resource.delete_bulk_request | train | protected static base_responses delete_bulk_request(nitro_service service,base_resource resources[]) throws Exception
{
if (!service.isLogin())
service.login();
options option = new options();
option.set_action("rm");
String type = resources[0].get_object_type();
if (type.indexOf("_binding") > 0)
{
option.set_action("unbind");
}
String id = service.get_sessionid();
String onerror = service.get_onerror();
Boolean warning = service.get_warning();
String request = service.get_payload_formatter().resource_to_string(resources, id, option,warning, onerror);
base_responses result = post_bulk_data(service,request);
return result;
} | java | {
"resource": ""
} |
q12814 | base_resource._put | train | private static String _put(nitro_service service, String request) throws Exception {
HttpURLConnection httpURLConnection;
StringBuilder responseStr = new StringBuilder();
try
{
String urlstr;
String ipaddress = service.get_ipaddress();
String version = service.get_version();
String protocol = service.get_protocol();
urlstr = protocol+"://" + ipaddress + "/nitro/" + version + "/config/";
URL url = new URL(urlstr);
httpURLConnection = (HttpURLConnection) url.openConnection();
httpURLConnection.setRequestMethod("PUT");
if (httpURLConnection instanceof HttpsURLConnection)
{
if (service.get_certvalidation()) {
SocketFactory sslSocketFactory = SSLSocketFactory.getDefault();
HttpsURLConnection secured = (HttpsURLConnection) httpURLConnection;
secured.setSSLSocketFactory((SSLSocketFactory)sslSocketFactory);
if (!service.get_hostnameverification()) {
/*
* override defualt hostNameverifier's verify method
* with EmptyHostnameVerifier's verify method to ignore hostname verification check.
*/
secured.setHostnameVerifier(new EmptyHostnameVerifier());
}
} else {
SSLContext sslContext = SSLContext.getInstance("SSL");
//we are using an empty trust manager, because NetScaler currently presents
//a test certificate not issued by any signing authority, so we need to bypass
//the credentials check
sslContext.init(null, new TrustManager[]{new EmptyTrustManager()}, null);
SocketFactory sslSocketFactory = sslContext.getSocketFactory();
HttpsURLConnection secured = (HttpsURLConnection) httpURLConnection;
secured.setSSLSocketFactory((SSLSocketFactory)sslSocketFactory);
if (!service.get_hostnameverification()) {
/*
* overriding defualt hostNameverifier's verify method
* with EmptyHostnameVerifier's verify method to bypass hostname check.
*/
secured.setHostnameVerifier(new EmptyHostnameVerifier());
}
}
}
httpURLConnection.setDoInput(true);
httpURLConnection.setDoOutput(true);
httpURLConnection.setUseCaches(false);
httpURLConnection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
httpURLConnection.setDoOutput(true);
OutputStreamWriter ouput = new OutputStreamWriter(httpURLConnection.getOutputStream());
ouput.write(request);
ouput.flush();
ouput.close();
InputStream input;
try {
input = httpURLConnection.getInputStream();
}
catch (Exception e) {
input = httpURLConnection.getErrorStream();
}
String contentEncoding = httpURLConnection.getContentEncoding();
// get correct input stream for compressed data:
if (contentEncoding != null)
{
if(contentEncoding.equalsIgnoreCase("gzip"))
input = new GZIPInputStream(input); //reads 2 bytes to determine GZIP stream!
else if(contentEncoding.equalsIgnoreCase("deflate"))
input = new InflaterInputStream(input);
}
int numOfTotalBytesRead;
byte [] buffer = new byte[1024];
while ((numOfTotalBytesRead = input.read(buffer, 0, buffer.length)) != -1)
{
responseStr.append(new String(buffer, 0, numOfTotalBytesRead));
}
httpURLConnection.disconnect();
input.close();
}
catch (MalformedURLException mue)
{
throw mue;
}
catch (IOException ioe)
{
throw ioe;
}
catch(Exception e)
{
throw e;
}
return responseStr.toString();
} | java | {
"resource": ""
} |
q12815 | nsevents.get | train | public static nsevents[] get(nitro_service service, options option) throws Exception{
nsevents obj = new nsevents();
nsevents[] response = (nsevents[])obj.get_resources(service,option);
return response;
} | java | {
"resource": ""
} |
q12816 | nsevents.get | train | public static nsevents[] get(nitro_service service, nsevents_args args) throws Exception{
nsevents obj = new nsevents();
options option = new options();
option.set_args(nitro_util.object_to_string_withoutquotes(args));
nsevents[] response = (nsevents[])obj.get_resources(service, option);
return response;
} | java | {
"resource": ""
} |
q12817 | sslpolicy_sslservice_binding.get | train | public static sslpolicy_sslservice_binding[] get(nitro_service service, String name) throws Exception{
sslpolicy_sslservice_binding obj = new sslpolicy_sslservice_binding();
obj.set_name(name);
sslpolicy_sslservice_binding response[] = (sslpolicy_sslservice_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q12818 | lbroute6.add | train | public static base_response add(nitro_service client, lbroute6 resource) throws Exception {
lbroute6 addresource = new lbroute6();
addresource.network = resource.network;
addresource.gatewayname = resource.gatewayname;
return addresource.add_resource(client);
} | java | {
"resource": ""
} |
q12819 | lbroute6.add | train | public static base_responses add(nitro_service client, lbroute6 resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
lbroute6 addresources[] = new lbroute6[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i] = new lbroute6();
addresources[i].network = resources[i].network;
addresources[i].gatewayname = resources[i].gatewayname;
}
result = add_bulk_request(client, addresources);
}
return result;
} | java | {
"resource": ""
} |
q12820 | lbroute6.get | train | public static lbroute6[] get(nitro_service service) throws Exception{
lbroute6 obj = new lbroute6();
lbroute6[] response = (lbroute6[])obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q12821 | lbroute6.get | train | public static lbroute6 get(nitro_service service, String network) throws Exception{
lbroute6 obj = new lbroute6();
obj.set_network(network);
lbroute6 response = (lbroute6) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q12822 | lbroute6.get | train | public static lbroute6[] get(nitro_service service, String network[]) throws Exception{
if (network !=null && network.length>0) {
lbroute6 response[] = new lbroute6[network.length];
lbroute6 obj[] = new lbroute6[network.length];
for (int i=0;i<network.length;i++) {
obj[i] = new lbroute6();
obj[i].set_network(network[i]);
response[i] = (lbroute6) obj[i].get_resource(service);
}
return response;
}
return null;
} | java | {
"resource": ""
} |
q12823 | l2param.update | train | public static base_response update(nitro_service client, l2param resource) throws Exception {
l2param updateresource = new l2param();
updateresource.mbfpeermacupdate = resource.mbfpeermacupdate;
updateresource.maxbridgecollision = resource.maxbridgecollision;
updateresource.bdggrpproxyarp = resource.bdggrpproxyarp;
updateresource.bdgsetting = resource.bdgsetting;
updateresource.garponvridintf = resource.garponvridintf;
updateresource.macmodefwdmypkt = resource.macmodefwdmypkt;
updateresource.usemymac = resource.usemymac;
updateresource.proxyarp = resource.proxyarp;
updateresource.garpreply = resource.garpreply;
updateresource.mbfinstlearning = resource.mbfinstlearning;
updateresource.rstintfonhafo = resource.rstintfonhafo;
updateresource.skipproxyingbsdtraffic = resource.skipproxyingbsdtraffic;
updateresource.returntoethernetsender = resource.returntoethernetsender;
return updateresource.update_resource(client);
} | java | {
"resource": ""
} |
q12824 | l2param.unset | train | public static base_response unset(nitro_service client, l2param resource, String[] args) throws Exception{
l2param unsetresource = new l2param();
return unsetresource.unset_resource(client,args);
} | java | {
"resource": ""
} |
q12825 | l2param.get | train | public static l2param get(nitro_service service) throws Exception{
l2param obj = new l2param();
l2param[] response = (l2param[])obj.get_resources(service);
return response[0];
} | java | {
"resource": ""
} |
q12826 | MetaClass.createFactory | train | public <E> ClassFactory<E> createFactory(String... classes) {
try {
return new ClassFactory<E>(classname, classes);
} catch (ClassCreationException e){
throw e;
} catch (Exception e) {
throw new ClassCreationException(e);
}
} | java | {
"resource": ""
} |
q12827 | MetaClass.createFactory | train | public <E> ClassFactory<E> createFactory(Object... objects) {
try {
return new ClassFactory<E>(classname, objects);
} catch (ClassCreationException e){
throw e;
} catch (Exception e) {
throw new ClassCreationException(e);
}
} | java | {
"resource": ""
} |
q12828 | MetaClass.type2class | train | private static Class <?> type2class(Type type){
if(type instanceof Class <?>){
return (Class <?>) type; //base case
}else if(type instanceof ParameterizedType){
return type2class( ((ParameterizedType) type).getRawType() );
}else if(type instanceof TypeVariable<?>){
return type2class( ((TypeVariable<?>) type).getBounds()[0] );
}else if(type instanceof WildcardType){
return type2class( ((WildcardType) type).getUpperBounds()[0] );
}else{
throw new IllegalArgumentException("Cannot convert type to class: " + type);
}
} | java | {
"resource": ""
} |
q12829 | MetaClass.decodeArray | train | private static final String[] decodeArray(String encoded){
char[] chars = encoded.trim().toCharArray();
//--Parse the String
//(state)
char quoteCloseChar = (char) 0;
List<StringBuilder> terms = new LinkedList<StringBuilder>();
StringBuilder current = new StringBuilder();
//(start/stop overhead)
int start = 0; int end = chars.length;
if(chars[0] == '('){ start += 1; end -= 1; if(chars[end] != ')') throw new IllegalArgumentException("Unclosed paren in encoded array: " + encoded); }
if(chars[0] == '['){ start += 1; end -= 1; if(chars[end] != ']') throw new IllegalArgumentException("Unclosed bracket in encoded array: " + encoded); }
//(finite state automata)
for(int i=start; i<end; i++){
if(chars[i] == '\\'){
//(case: escaped character)
if(i == chars.length - 1) throw new IllegalArgumentException("Last character of encoded pair is escape character: " + encoded);
current.append(chars[i+1]);
i += 1;
} else if(quoteCloseChar != 0){
//(case: in quotes)
if(chars[i] == quoteCloseChar){
quoteCloseChar = (char) 0;
}else{
current.append(chars[i]);
}
}else{
//(case: normal)
if(chars[i] == '"'){ quoteCloseChar = '"';
} else if(chars[i] == '\''){ quoteCloseChar = '\'';
} else if(chars[i] == ','){
//break
terms.add(current);
current = new StringBuilder();
}else{
current.append(chars[i]);
}
}
}
//--Return
if(current.length() > 0) terms.add(current);
String[] rtn = new String[terms.size()];
int i=0;
for(StringBuilder b : terms){
rtn[i] = b.toString().trim();
i += 1;
}
return rtn;
} | java | {
"resource": ""
} |
q12830 | linkset_binding.get | train | public static linkset_binding get(nitro_service service, String id) throws Exception{
linkset_binding obj = new linkset_binding();
obj.set_id(id);
linkset_binding response = (linkset_binding) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q12831 | sslfipssimtarget.enable | train | public static base_response enable(nitro_service client, sslfipssimtarget resource) throws Exception {
sslfipssimtarget enableresource = new sslfipssimtarget();
enableresource.keyvector = resource.keyvector;
enableresource.sourcesecret = resource.sourcesecret;
return enableresource.perform_operation(client,"enable");
} | java | {
"resource": ""
} |
q12832 | sslfipssimtarget.init | train | public static base_response init(nitro_service client, sslfipssimtarget resource) throws Exception {
sslfipssimtarget initresource = new sslfipssimtarget();
initresource.certfile = resource.certfile;
initresource.keyvector = resource.keyvector;
initresource.targetsecret = resource.targetsecret;
return initresource.perform_operation(client,"init");
} | java | {
"resource": ""
} |
q12833 | rewritepolicy_stats.get | train | public static rewritepolicy_stats[] get(nitro_service service, options option) throws Exception{
rewritepolicy_stats obj = new rewritepolicy_stats();
rewritepolicy_stats[] response = (rewritepolicy_stats[])obj.stat_resources(service,option);
return response;
} | java | {
"resource": ""
} |
q12834 | rewritepolicy_stats.get | train | public static rewritepolicy_stats get(nitro_service service, String name) throws Exception{
rewritepolicy_stats obj = new rewritepolicy_stats();
obj.set_name(name);
rewritepolicy_stats response = (rewritepolicy_stats) obj.stat_resource(service);
return response;
} | java | {
"resource": ""
} |
q12835 | rewritepolicylabel_binding.get | train | public static rewritepolicylabel_binding get(nitro_service service, String labelname) throws Exception{
rewritepolicylabel_binding obj = new rewritepolicylabel_binding();
obj.set_labelname(labelname);
rewritepolicylabel_binding response = (rewritepolicylabel_binding) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q12836 | tmsessionpolicy_authenticationvserver_binding.get | train | public static tmsessionpolicy_authenticationvserver_binding[] get(nitro_service service, String name) throws Exception{
tmsessionpolicy_authenticationvserver_binding obj = new tmsessionpolicy_authenticationvserver_binding();
obj.set_name(name);
tmsessionpolicy_authenticationvserver_binding response[] = (tmsessionpolicy_authenticationvserver_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q12837 | authenticationvserver_authenticationsamlpolicy_binding.get | train | public static authenticationvserver_authenticationsamlpolicy_binding[] get(nitro_service service, String name) throws Exception{
authenticationvserver_authenticationsamlpolicy_binding obj = new authenticationvserver_authenticationsamlpolicy_binding();
obj.set_name(name);
authenticationvserver_authenticationsamlpolicy_binding response[] = (authenticationvserver_authenticationsamlpolicy_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q12838 | hanode.add | train | public static base_response add(nitro_service client, hanode resource) throws Exception {
hanode addresource = new hanode();
addresource.id = resource.id;
addresource.ipaddress = resource.ipaddress;
addresource.inc = resource.inc;
return addresource.add_resource(client);
} | java | {
"resource": ""
} |
q12839 | hanode.add | train | public static base_responses add(nitro_service client, hanode resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
hanode addresources[] = new hanode[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i] = new hanode();
addresources[i].id = resources[i].id;
addresources[i].ipaddress = resources[i].ipaddress;
addresources[i].inc = resources[i].inc;
}
result = add_bulk_request(client, addresources);
}
return result;
} | java | {
"resource": ""
} |
q12840 | hanode.update | train | public static base_response update(nitro_service client, hanode resource) throws Exception {
hanode updateresource = new hanode();
updateresource.id = resource.id;
updateresource.hastatus = resource.hastatus;
updateresource.hasync = resource.hasync;
updateresource.haprop = resource.haprop;
updateresource.hellointerval = resource.hellointerval;
updateresource.deadinterval = resource.deadinterval;
updateresource.failsafe = resource.failsafe;
updateresource.maxflips = resource.maxflips;
updateresource.maxfliptime = resource.maxfliptime;
updateresource.syncvlan = resource.syncvlan;
return updateresource.update_resource(client);
} | java | {
"resource": ""
} |
q12841 | hanode.update | train | public static base_responses update(nitro_service client, hanode resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
hanode updateresources[] = new hanode[resources.length];
for (int i=0;i<resources.length;i++){
updateresources[i] = new hanode();
updateresources[i].id = resources[i].id;
updateresources[i].hastatus = resources[i].hastatus;
updateresources[i].hasync = resources[i].hasync;
updateresources[i].haprop = resources[i].haprop;
updateresources[i].hellointerval = resources[i].hellointerval;
updateresources[i].deadinterval = resources[i].deadinterval;
updateresources[i].failsafe = resources[i].failsafe;
updateresources[i].maxflips = resources[i].maxflips;
updateresources[i].maxfliptime = resources[i].maxfliptime;
updateresources[i].syncvlan = resources[i].syncvlan;
}
result = update_bulk_request(client, updateresources);
}
return result;
} | java | {
"resource": ""
} |
q12842 | hanode.unset | train | public static base_responses unset(nitro_service client, hanode resources[], String[] args) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
hanode unsetresources[] = new hanode[resources.length];
for (int i=0;i<resources.length;i++){
unsetresources[i] = new hanode();
unsetresources[i].id = resources[i].id;
}
result = unset_bulk_request(client, unsetresources,args);
}
return result;
} | java | {
"resource": ""
} |
q12843 | hanode.get | train | public static hanode[] get(nitro_service service) throws Exception{
hanode obj = new hanode();
hanode[] response = (hanode[])obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q12844 | hanode.get | train | public static hanode get(nitro_service service, Long id) throws Exception{
hanode obj = new hanode();
obj.set_id(id);
hanode response = (hanode) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q12845 | hanode.get | train | public static hanode[] get(nitro_service service, Long id[]) throws Exception{
if (id !=null && id.length>0) {
hanode response[] = new hanode[id.length];
hanode obj[] = new hanode[id.length];
for (int i=0;i<id.length;i++) {
obj[i] = new hanode();
obj[i].set_id(id[i]);
response[i] = (hanode) obj[i].get_resource(service);
}
return response;
}
return null;
} | java | {
"resource": ""
} |
q12846 | aaaradiusparams.update | train | public static base_response update(nitro_service client, aaaradiusparams resource) throws Exception {
aaaradiusparams updateresource = new aaaradiusparams();
updateresource.serverip = resource.serverip;
updateresource.serverport = resource.serverport;
updateresource.authtimeout = resource.authtimeout;
updateresource.radkey = resource.radkey;
updateresource.radnasip = resource.radnasip;
updateresource.radnasid = resource.radnasid;
updateresource.radvendorid = resource.radvendorid;
updateresource.radattributetype = resource.radattributetype;
updateresource.radgroupsprefix = resource.radgroupsprefix;
updateresource.radgroupseparator = resource.radgroupseparator;
updateresource.passencoding = resource.passencoding;
updateresource.ipvendorid = resource.ipvendorid;
updateresource.ipattributetype = resource.ipattributetype;
updateresource.accounting = resource.accounting;
updateresource.pwdvendorid = resource.pwdvendorid;
updateresource.pwdattributetype = resource.pwdattributetype;
updateresource.defaultauthenticationgroup = resource.defaultauthenticationgroup;
updateresource.callingstationid = resource.callingstationid;
return updateresource.update_resource(client);
} | java | {
"resource": ""
} |
q12847 | aaaradiusparams.unset | train | public static base_response unset(nitro_service client, aaaradiusparams resource, String[] args) throws Exception{
aaaradiusparams unsetresource = new aaaradiusparams();
return unsetresource.unset_resource(client,args);
} | java | {
"resource": ""
} |
q12848 | aaaradiusparams.get | train | public static aaaradiusparams get(nitro_service service) throws Exception{
aaaradiusparams obj = new aaaradiusparams();
aaaradiusparams[] response = (aaaradiusparams[])obj.get_resources(service);
return response[0];
} | java | {
"resource": ""
} |
q12849 | nssurgeq.flush | train | public static base_response flush(nitro_service client, nssurgeq resource) throws Exception {
nssurgeq flushresource = new nssurgeq();
flushresource.name = resource.name;
flushresource.servername = resource.servername;
flushresource.port = resource.port;
return flushresource.perform_operation(client,"flush");
} | java | {
"resource": ""
} |
q12850 | MtasCodecPostingsFormat.getToken | train | public static MtasTokenString getToken(IndexInput inObject, IndexInput inTerm,
Long ref) throws IOException {
MtasTokenString token = null;
try {
inObject.seek(ref);
token = new MtasTokenString(null, "");
token.setId(inObject.readVInt());
token.setTokenRef(ref);
int objectFlags = inObject.readVInt();
int[] positions = null;
if ((objectFlags & MTAS_OBJECT_HAS_PARENT) == MTAS_OBJECT_HAS_PARENT) {
int parentId = inObject.readVInt();
token.setParentId(parentId);
}
if ((objectFlags
& MTAS_OBJECT_HAS_POSITION_RANGE) == MTAS_OBJECT_HAS_POSITION_RANGE) {
int positionStart = inObject.readVInt();
int positionEnd = positionStart + inObject.readVInt();
token.addPositionRange(positionStart, positionEnd);
} else if ((objectFlags
& MTAS_OBJECT_HAS_POSITION_SET) == MTAS_OBJECT_HAS_POSITION_SET) {
int size = inObject.readVInt();
int tmpPrevious = 0;
positions = new int[size];
for (int t = 0; t < size; t++) {
int position = tmpPrevious + inObject.readVInt();
tmpPrevious = position;
positions[t] = position;
}
token.addPositions(positions);
} else {
int position = inObject.readVInt();
token.addPosition(position);
}
if ((objectFlags & MTAS_OBJECT_HAS_OFFSET) == MTAS_OBJECT_HAS_OFFSET) {
int offsetStart = inObject.readVInt();
int offsetEnd = offsetStart + inObject.readVInt();
token.setOffset(offsetStart, offsetEnd);
}
if ((objectFlags
& MTAS_OBJECT_HAS_REALOFFSET) == MTAS_OBJECT_HAS_REALOFFSET) {
int realOffsetStart = inObject.readVInt();
int realOffsetEnd = realOffsetStart + inObject.readVInt();
token.setRealOffset(realOffsetStart, realOffsetEnd);
}
if ((objectFlags & MTAS_OBJECT_HAS_PAYLOAD) == MTAS_OBJECT_HAS_PAYLOAD) {
int length = inObject.readVInt();
byte[] mtasPayload = new byte[length];
inObject.readBytes(mtasPayload, 0, length);
token.setPayload(new BytesRef(mtasPayload));
}
Long termRef = inObject.readVLong();
inTerm.seek(termRef);
token.setTermRef(termRef);
token.setValue(inTerm.readString());
} catch (Exception e) {
throw new IOException(e);
}
return token;
} | java | {
"resource": ""
} |
q12851 | MtasCodecPostingsFormat.getTerm | train | public static String getTerm(IndexInput inTerm, Long ref) throws IOException {
try {
inTerm.seek(ref);
return inTerm.readString();
} catch (Exception e) {
throw new IOException(e);
}
} | java | {
"resource": ""
} |
q12852 | OutputHandler.colorChannel | train | public void colorChannel(String channel, Color color){
if(this.channelColors == null){
this.channelColors = new HashMap<String,Color>();
}
this.channelColors.put(channel.toLowerCase(),color);
} | java | {
"resource": ""
} |
q12853 | OutputHandler.styleChannel | train | public void styleChannel(String channel, Style style){
if(this.channelStyles == null){
this.channelStyles = new HashMap<String,Style>();
}
this.channelStyles.put(channel.toLowerCase(),style);
} | java | {
"resource": ""
} |
q12854 | OutputHandler.style | train | protected StringBuilder style(StringBuilder b, String line, Color color, Style style){
if(color != Color.NONE || style != Style.NONE){
b.append(color.ansiCode);
b.append(style.ansiCode);
b.append(line);
b.append("\033[0m");
} else {
b.append(line);
}
return b;
} | java | {
"resource": ""
} |
q12855 | protocoltcp_stats.get | train | public static protocoltcp_stats get(nitro_service service) throws Exception{
protocoltcp_stats obj = new protocoltcp_stats();
protocoltcp_stats[] response = (protocoltcp_stats[])obj.stat_resources(service);
return response[0];
} | java | {
"resource": ""
} |
q12856 | responderpolicy_lbvserver_binding.get | train | public static responderpolicy_lbvserver_binding[] get(nitro_service service, String name) throws Exception{
responderpolicy_lbvserver_binding obj = new responderpolicy_lbvserver_binding();
obj.set_name(name);
responderpolicy_lbvserver_binding response[] = (responderpolicy_lbvserver_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q12857 | sslservicegroup_sslcipher_binding.get | train | public static sslservicegroup_sslcipher_binding[] get(nitro_service service, String servicegroupname) throws Exception{
sslservicegroup_sslcipher_binding obj = new sslservicegroup_sslcipher_binding();
obj.set_servicegroupname(servicegroupname);
sslservicegroup_sslcipher_binding response[] = (sslservicegroup_sslcipher_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q12858 | tmsessionaction.add | train | public static base_response add(nitro_service client, tmsessionaction resource) throws Exception {
tmsessionaction addresource = new tmsessionaction();
addresource.name = resource.name;
addresource.sesstimeout = resource.sesstimeout;
addresource.defaultauthorizationaction = resource.defaultauthorizationaction;
addresource.sso = resource.sso;
addresource.ssocredential = resource.ssocredential;
addresource.ssodomain = resource.ssodomain;
addresource.httponlycookie = resource.httponlycookie;
addresource.kcdaccount = resource.kcdaccount;
addresource.persistentcookie = resource.persistentcookie;
addresource.persistentcookievalidity = resource.persistentcookievalidity;
addresource.homepage = resource.homepage;
return addresource.add_resource(client);
} | java | {
"resource": ""
} |
q12859 | tmsessionaction.add | train | public static base_responses add(nitro_service client, tmsessionaction resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
tmsessionaction addresources[] = new tmsessionaction[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i] = new tmsessionaction();
addresources[i].name = resources[i].name;
addresources[i].sesstimeout = resources[i].sesstimeout;
addresources[i].defaultauthorizationaction = resources[i].defaultauthorizationaction;
addresources[i].sso = resources[i].sso;
addresources[i].ssocredential = resources[i].ssocredential;
addresources[i].ssodomain = resources[i].ssodomain;
addresources[i].httponlycookie = resources[i].httponlycookie;
addresources[i].kcdaccount = resources[i].kcdaccount;
addresources[i].persistentcookie = resources[i].persistentcookie;
addresources[i].persistentcookievalidity = resources[i].persistentcookievalidity;
addresources[i].homepage = resources[i].homepage;
}
result = add_bulk_request(client, addresources);
}
return result;
} | java | {
"resource": ""
} |
q12860 | tmsessionaction.update | train | public static base_response update(nitro_service client, tmsessionaction resource) throws Exception {
tmsessionaction updateresource = new tmsessionaction();
updateresource.name = resource.name;
updateresource.sesstimeout = resource.sesstimeout;
updateresource.defaultauthorizationaction = resource.defaultauthorizationaction;
updateresource.sso = resource.sso;
updateresource.ssocredential = resource.ssocredential;
updateresource.ssodomain = resource.ssodomain;
updateresource.kcdaccount = resource.kcdaccount;
updateresource.httponlycookie = resource.httponlycookie;
updateresource.persistentcookie = resource.persistentcookie;
updateresource.persistentcookievalidity = resource.persistentcookievalidity;
updateresource.homepage = resource.homepage;
return updateresource.update_resource(client);
} | java | {
"resource": ""
} |
q12861 | tmsessionaction.update | train | public static base_responses update(nitro_service client, tmsessionaction resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
tmsessionaction updateresources[] = new tmsessionaction[resources.length];
for (int i=0;i<resources.length;i++){
updateresources[i] = new tmsessionaction();
updateresources[i].name = resources[i].name;
updateresources[i].sesstimeout = resources[i].sesstimeout;
updateresources[i].defaultauthorizationaction = resources[i].defaultauthorizationaction;
updateresources[i].sso = resources[i].sso;
updateresources[i].ssocredential = resources[i].ssocredential;
updateresources[i].ssodomain = resources[i].ssodomain;
updateresources[i].kcdaccount = resources[i].kcdaccount;
updateresources[i].httponlycookie = resources[i].httponlycookie;
updateresources[i].persistentcookie = resources[i].persistentcookie;
updateresources[i].persistentcookievalidity = resources[i].persistentcookievalidity;
updateresources[i].homepage = resources[i].homepage;
}
result = update_bulk_request(client, updateresources);
}
return result;
} | java | {
"resource": ""
} |
q12862 | tmsessionaction.get | train | public static tmsessionaction[] get(nitro_service service) throws Exception{
tmsessionaction obj = new tmsessionaction();
tmsessionaction[] response = (tmsessionaction[])obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q12863 | tmsessionaction.get | train | public static tmsessionaction get(nitro_service service, String name) throws Exception{
tmsessionaction obj = new tmsessionaction();
obj.set_name(name);
tmsessionaction response = (tmsessionaction) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q12864 | lbwlm.add | train | public static base_response add(nitro_service client, lbwlm resource) throws Exception {
lbwlm addresource = new lbwlm();
addresource.wlmname = resource.wlmname;
addresource.ipaddress = resource.ipaddress;
addresource.port = resource.port;
addresource.lbuid = resource.lbuid;
addresource.katimeout = resource.katimeout;
return addresource.add_resource(client);
} | java | {
"resource": ""
} |
q12865 | lbwlm.add | train | public static base_responses add(nitro_service client, lbwlm resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
lbwlm addresources[] = new lbwlm[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i] = new lbwlm();
addresources[i].wlmname = resources[i].wlmname;
addresources[i].ipaddress = resources[i].ipaddress;
addresources[i].port = resources[i].port;
addresources[i].lbuid = resources[i].lbuid;
addresources[i].katimeout = resources[i].katimeout;
}
result = add_bulk_request(client, addresources);
}
return result;
} | java | {
"resource": ""
} |
q12866 | lbwlm.delete | train | public static base_response delete(nitro_service client, String wlmname) throws Exception {
lbwlm deleteresource = new lbwlm();
deleteresource.wlmname = wlmname;
return deleteresource.delete_resource(client);
} | java | {
"resource": ""
} |
q12867 | lbwlm.delete | train | public static base_responses delete(nitro_service client, String wlmname[]) throws Exception {
base_responses result = null;
if (wlmname != null && wlmname.length > 0) {
lbwlm deleteresources[] = new lbwlm[wlmname.length];
for (int i=0;i<wlmname.length;i++){
deleteresources[i] = new lbwlm();
deleteresources[i].wlmname = wlmname[i];
}
result = delete_bulk_request(client, deleteresources);
}
return result;
} | java | {
"resource": ""
} |
q12868 | lbwlm.update | train | public static base_response update(nitro_service client, lbwlm resource) throws Exception {
lbwlm updateresource = new lbwlm();
updateresource.wlmname = resource.wlmname;
updateresource.katimeout = resource.katimeout;
return updateresource.update_resource(client);
} | java | {
"resource": ""
} |
q12869 | lbwlm.update | train | public static base_responses update(nitro_service client, lbwlm resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
lbwlm updateresources[] = new lbwlm[resources.length];
for (int i=0;i<resources.length;i++){
updateresources[i] = new lbwlm();
updateresources[i].wlmname = resources[i].wlmname;
updateresources[i].katimeout = resources[i].katimeout;
}
result = update_bulk_request(client, updateresources);
}
return result;
} | java | {
"resource": ""
} |
q12870 | lbwlm.unset | train | public static base_response unset(nitro_service client, lbwlm resource, String[] args) throws Exception{
lbwlm unsetresource = new lbwlm();
unsetresource.wlmname = resource.wlmname;
return unsetresource.unset_resource(client,args);
} | java | {
"resource": ""
} |
q12871 | lbwlm.unset | train | public static base_responses unset(nitro_service client, String wlmname[], String args[]) throws Exception {
base_responses result = null;
if (wlmname != null && wlmname.length > 0) {
lbwlm unsetresources[] = new lbwlm[wlmname.length];
for (int i=0;i<wlmname.length;i++){
unsetresources[i] = new lbwlm();
unsetresources[i].wlmname = wlmname[i];
}
result = unset_bulk_request(client, unsetresources,args);
}
return result;
} | java | {
"resource": ""
} |
q12872 | lbwlm.get | train | public static lbwlm[] get(nitro_service service, options option) throws Exception{
lbwlm obj = new lbwlm();
lbwlm[] response = (lbwlm[])obj.get_resources(service,option);
return response;
} | java | {
"resource": ""
} |
q12873 | lbwlm.get | train | public static lbwlm get(nitro_service service, String wlmname) throws Exception{
lbwlm obj = new lbwlm();
obj.set_wlmname(wlmname);
lbwlm response = (lbwlm) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q12874 | lbwlm.get | train | public static lbwlm[] get(nitro_service service, String wlmname[]) throws Exception{
if (wlmname !=null && wlmname.length>0) {
lbwlm response[] = new lbwlm[wlmname.length];
lbwlm obj[] = new lbwlm[wlmname.length];
for (int i=0;i<wlmname.length;i++) {
obj[i] = new lbwlm();
obj[i].set_wlmname(wlmname[i]);
response[i] = (lbwlm) obj[i].get_resource(service);
}
return response;
}
return null;
} | java | {
"resource": ""
} |
q12875 | tmglobal_tmtrafficpolicy_binding.get | train | public static tmglobal_tmtrafficpolicy_binding[] get(nitro_service service) throws Exception{
tmglobal_tmtrafficpolicy_binding obj = new tmglobal_tmtrafficpolicy_binding();
tmglobal_tmtrafficpolicy_binding response[] = (tmglobal_tmtrafficpolicy_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q12876 | vpnvserver.add | train | public static base_response add(nitro_service client, vpnvserver resource) throws Exception {
vpnvserver addresource = new vpnvserver();
addresource.name = resource.name;
addresource.servicetype = resource.servicetype;
addresource.ipv46 = resource.ipv46;
addresource.range = resource.range;
addresource.port = resource.port;
addresource.state = resource.state;
addresource.authentication = resource.authentication;
addresource.doublehop = resource.doublehop;
addresource.maxaaausers = resource.maxaaausers;
addresource.icaonly = resource.icaonly;
addresource.downstateflush = resource.downstateflush;
addresource.listenpolicy = resource.listenpolicy;
addresource.listenpriority = resource.listenpriority;
addresource.tcpprofilename = resource.tcpprofilename;
addresource.httpprofilename = resource.httpprofilename;
addresource.comment = resource.comment;
addresource.appflowlog = resource.appflowlog;
addresource.icmpvsrresponse = resource.icmpvsrresponse;
addresource.netprofile = resource.netprofile;
addresource.cginfrahomepageredirect = resource.cginfrahomepageredirect;
addresource.maxloginattempts = resource.maxloginattempts;
addresource.failedlogintimeout = resource.failedlogintimeout;
return addresource.add_resource(client);
} | java | {
"resource": ""
} |
q12877 | vpnvserver.add | train | public static base_responses add(nitro_service client, vpnvserver resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
vpnvserver addresources[] = new vpnvserver[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i] = new vpnvserver();
addresources[i].name = resources[i].name;
addresources[i].servicetype = resources[i].servicetype;
addresources[i].ipv46 = resources[i].ipv46;
addresources[i].range = resources[i].range;
addresources[i].port = resources[i].port;
addresources[i].state = resources[i].state;
addresources[i].authentication = resources[i].authentication;
addresources[i].doublehop = resources[i].doublehop;
addresources[i].maxaaausers = resources[i].maxaaausers;
addresources[i].icaonly = resources[i].icaonly;
addresources[i].downstateflush = resources[i].downstateflush;
addresources[i].listenpolicy = resources[i].listenpolicy;
addresources[i].listenpriority = resources[i].listenpriority;
addresources[i].tcpprofilename = resources[i].tcpprofilename;
addresources[i].httpprofilename = resources[i].httpprofilename;
addresources[i].comment = resources[i].comment;
addresources[i].appflowlog = resources[i].appflowlog;
addresources[i].icmpvsrresponse = resources[i].icmpvsrresponse;
addresources[i].netprofile = resources[i].netprofile;
addresources[i].cginfrahomepageredirect = resources[i].cginfrahomepageredirect;
addresources[i].maxloginattempts = resources[i].maxloginattempts;
addresources[i].failedlogintimeout = resources[i].failedlogintimeout;
}
result = add_bulk_request(client, addresources);
}
return result;
} | java | {
"resource": ""
} |
q12878 | vpnvserver.update | train | public static base_response update(nitro_service client, vpnvserver resource) throws Exception {
vpnvserver updateresource = new vpnvserver();
updateresource.name = resource.name;
updateresource.ipv46 = resource.ipv46;
updateresource.authentication = resource.authentication;
updateresource.doublehop = resource.doublehop;
updateresource.icaonly = resource.icaonly;
updateresource.maxaaausers = resource.maxaaausers;
updateresource.downstateflush = resource.downstateflush;
updateresource.listenpolicy = resource.listenpolicy;
updateresource.listenpriority = resource.listenpriority;
updateresource.tcpprofilename = resource.tcpprofilename;
updateresource.httpprofilename = resource.httpprofilename;
updateresource.comment = resource.comment;
updateresource.appflowlog = resource.appflowlog;
updateresource.icmpvsrresponse = resource.icmpvsrresponse;
updateresource.netprofile = resource.netprofile;
updateresource.cginfrahomepageredirect = resource.cginfrahomepageredirect;
updateresource.maxloginattempts = resource.maxloginattempts;
updateresource.failedlogintimeout = resource.failedlogintimeout;
return updateresource.update_resource(client);
} | java | {
"resource": ""
} |
q12879 | vpnvserver.update | train | public static base_responses update(nitro_service client, vpnvserver resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
vpnvserver updateresources[] = new vpnvserver[resources.length];
for (int i=0;i<resources.length;i++){
updateresources[i] = new vpnvserver();
updateresources[i].name = resources[i].name;
updateresources[i].ipv46 = resources[i].ipv46;
updateresources[i].authentication = resources[i].authentication;
updateresources[i].doublehop = resources[i].doublehop;
updateresources[i].icaonly = resources[i].icaonly;
updateresources[i].maxaaausers = resources[i].maxaaausers;
updateresources[i].downstateflush = resources[i].downstateflush;
updateresources[i].listenpolicy = resources[i].listenpolicy;
updateresources[i].listenpriority = resources[i].listenpriority;
updateresources[i].tcpprofilename = resources[i].tcpprofilename;
updateresources[i].httpprofilename = resources[i].httpprofilename;
updateresources[i].comment = resources[i].comment;
updateresources[i].appflowlog = resources[i].appflowlog;
updateresources[i].icmpvsrresponse = resources[i].icmpvsrresponse;
updateresources[i].netprofile = resources[i].netprofile;
updateresources[i].cginfrahomepageredirect = resources[i].cginfrahomepageredirect;
updateresources[i].maxloginattempts = resources[i].maxloginattempts;
updateresources[i].failedlogintimeout = resources[i].failedlogintimeout;
}
result = update_bulk_request(client, updateresources);
}
return result;
} | java | {
"resource": ""
} |
q12880 | vpnvserver.get | train | public static vpnvserver[] get(nitro_service service) throws Exception{
vpnvserver obj = new vpnvserver();
vpnvserver[] response = (vpnvserver[])obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q12881 | vpnvserver.get | train | public static vpnvserver get(nitro_service service, String name) throws Exception{
vpnvserver obj = new vpnvserver();
obj.set_name(name);
vpnvserver response = (vpnvserver) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q12882 | rewritepolicy_rewritepolicylabel_binding.get | train | public static rewritepolicy_rewritepolicylabel_binding[] get(nitro_service service, String name) throws Exception{
rewritepolicy_rewritepolicylabel_binding obj = new rewritepolicy_rewritepolicylabel_binding();
obj.set_name(name);
rewritepolicy_rewritepolicylabel_binding response[] = (rewritepolicy_rewritepolicylabel_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q12883 | PTBLexer.delimit | train | private static String delimit(String s, char c) {
int i = s.indexOf(c);
while (i != -1) {
if (i == 0 || s.charAt(i - 1) != '\\') {
s = s.substring(0, i) + '\\' + s.substring(i);
i = s.indexOf(c, i + 2);
} else {
i = s.indexOf(c, i + 1);
}
}
return s;
} | java | {
"resource": ""
} |
q12884 | PTBLexer.getNext | train | private Object getNext(String txt, String originalText) {
if (invertible) {
String str = prevWordAfter.toString();
prevWordAfter.setLength(0);
CoreLabel word = (CoreLabel) tokenFactory.makeToken(txt, yychar, yylength());
word.set(OriginalTextAnnotation.class, originalText);
word.set(BeforeAnnotation.class, str);
prevWord.set(AfterAnnotation.class, str);
prevWord = word;
return word;
} else {
return tokenFactory.makeToken(txt, yychar, yylength());
}
} | java | {
"resource": ""
} |
q12885 | vpntrafficpolicy_binding.get | train | public static vpntrafficpolicy_binding get(nitro_service service, String name) throws Exception{
vpntrafficpolicy_binding obj = new vpntrafficpolicy_binding();
obj.set_name(name);
vpntrafficpolicy_binding response = (vpntrafficpolicy_binding) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q12886 | vpnvserver_vpnclientlessaccesspolicy_binding.get | train | public static vpnvserver_vpnclientlessaccesspolicy_binding[] get(nitro_service service, String name) throws Exception{
vpnvserver_vpnclientlessaccesspolicy_binding obj = new vpnvserver_vpnclientlessaccesspolicy_binding();
obj.set_name(name);
vpnvserver_vpnclientlessaccesspolicy_binding response[] = (vpnvserver_vpnclientlessaccesspolicy_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q12887 | authenticationsamlpolicy_binding.get | train | public static authenticationsamlpolicy_binding get(nitro_service service, String name) throws Exception{
authenticationsamlpolicy_binding obj = new authenticationsamlpolicy_binding();
obj.set_name(name);
authenticationsamlpolicy_binding response = (authenticationsamlpolicy_binding) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q12888 | autoscalepolicy.unset | train | public static base_response unset(nitro_service client, autoscalepolicy resource, String[] args) throws Exception{
autoscalepolicy unsetresource = new autoscalepolicy();
unsetresource.name = resource.name;
unsetresource.rule = resource.rule;
unsetresource.action = resource.action;
unsetresource.comment = resource.comment;
unsetresource.logaction = resource.logaction;
return unsetresource.unset_resource(client,args);
} | java | {
"resource": ""
} |
q12889 | autoscalepolicy.unset | train | public static base_responses unset(nitro_service client, autoscalepolicy resources[], String[] args) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
autoscalepolicy unsetresources[] = new autoscalepolicy[resources.length];
for (int i=0;i<resources.length;i++){
unsetresources[i] = new autoscalepolicy();
unsetresources[i].name = resources[i].name;
unsetresources[i].rule = resources[i].rule;
unsetresources[i].action = resources[i].action;
unsetresources[i].comment = resources[i].comment;
unsetresources[i].logaction = resources[i].logaction;
}
result = unset_bulk_request(client, unsetresources,args);
}
return result;
} | java | {
"resource": ""
} |
q12890 | autoscalepolicy.get | train | public static autoscalepolicy[] get(nitro_service service) throws Exception{
autoscalepolicy obj = new autoscalepolicy();
autoscalepolicy[] response = (autoscalepolicy[])obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q12891 | autoscalepolicy.get | train | public static autoscalepolicy get(nitro_service service, String name) throws Exception{
autoscalepolicy obj = new autoscalepolicy();
obj.set_name(name);
autoscalepolicy response = (autoscalepolicy) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q12892 | aaauser_vpnintranetapplication_binding.get | train | public static aaauser_vpnintranetapplication_binding[] get(nitro_service service, String username) throws Exception{
aaauser_vpnintranetapplication_binding obj = new aaauser_vpnintranetapplication_binding();
obj.set_username(username);
aaauser_vpnintranetapplication_binding response[] = (aaauser_vpnintranetapplication_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q12893 | aaauser_vpnintranetapplication_binding.count | train | public static long count(nitro_service service, String username) throws Exception{
aaauser_vpnintranetapplication_binding obj = new aaauser_vpnintranetapplication_binding();
obj.set_username(username);
options option = new options();
option.set_count(true);
aaauser_vpnintranetapplication_binding response[] = (aaauser_vpnintranetapplication_binding[]) obj.get_resources(service,option);
if (response != null) {
return response[0].__count;
}
return 0;
} | java | {
"resource": ""
} |
q12894 | responderpolicylabel.add | train | public static base_responses add(nitro_service client, responderpolicylabel resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
responderpolicylabel addresources[] = new responderpolicylabel[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i] = new responderpolicylabel();
addresources[i].labelname = resources[i].labelname;
addresources[i].policylabeltype = resources[i].policylabeltype;
}
result = add_bulk_request(client, addresources);
}
return result;
} | java | {
"resource": ""
} |
q12895 | responderpolicylabel.get | train | public static responderpolicylabel[] get(nitro_service service, options option) throws Exception{
responderpolicylabel obj = new responderpolicylabel();
responderpolicylabel[] response = (responderpolicylabel[])obj.get_resources(service,option);
return response;
} | java | {
"resource": ""
} |
q12896 | responderpolicylabel.get | train | public static responderpolicylabel get(nitro_service service, String labelname) throws Exception{
responderpolicylabel obj = new responderpolicylabel();
obj.set_labelname(labelname);
responderpolicylabel response = (responderpolicylabel) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q12897 | channel_interface_binding.get | train | public static channel_interface_binding[] get(nitro_service service, String id) throws Exception{
channel_interface_binding obj = new channel_interface_binding();
obj.set_id(id);
channel_interface_binding response[] = (channel_interface_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q12898 | GrammaticalStructure.getDep | train | private static void getDep(TreeGraphNode t, List<TypedDependency> basicDep,
Filter<TypedDependency> f) {
if (t.isPhrasal()) { // don't do leaves of POS tags (chris changed this from numChildren > 0 in 2010)
Map<Class<? extends CoreAnnotation>, Set<TreeGraphNode>> depMap = getAllDependents(t);
for (Class<? extends CoreAnnotation> depName : depMap.keySet()) {
for (TreeGraphNode depNode : depMap.get(depName)) {
TreeGraphNode gov = t.headWordNode();
TreeGraphNode dep = depNode.headWordNode();
if (gov != dep) {
List<GrammaticalRelation> rels = getListGrammaticalRelation(t, depNode);
if (!rels.isEmpty()) {
for (GrammaticalRelation rel : rels) {
TypedDependency newDep = new TypedDependency(rel, gov, dep);
if (!basicDep.contains(newDep) && f.accept(newDep)) {
newDep.setExtra();
basicDep.add(newDep);
}
}
}
}
}
}
// now recurse into children
for (Tree kid : t.children()) {
getDep((TreeGraphNode) kid, basicDep, f);
}
}
} | java | {
"resource": ""
} |
q12899 | GrammaticalStructure.getListGrammaticalRelation | train | public static List<GrammaticalRelation> getListGrammaticalRelation(TreeGraphNode gov, TreeGraphNode dep) {
List<GrammaticalRelation> list = new ArrayList<GrammaticalRelation>();
TreeGraphNode govH = gov.highestNodeWithSameHead();
TreeGraphNode depH = dep.highestNodeWithSameHead();
/*System.out.println("Extra gov node " + gov);
System.out.println("govH " + govH);
System.out.println("dep node " + dep);
System.out.println("depH " + depH);*/
Set<Class<? extends GrammaticalRelationAnnotation>> arcLabels = govH.arcLabelsToNode(depH);
//System.out.println("arcLabels: " + arcLabels);
if (dep != depH) {
Set<Class<? extends GrammaticalRelationAnnotation>> arcLabels2 = govH.arcLabelsToNode(dep);
//System.out.println("arcLabels2: " + arcLabels2);
arcLabels.addAll(arcLabels2);
}
//System.out.println("arcLabels: " + arcLabels);
for (Class<? extends GrammaticalRelationAnnotation> arcLabel : arcLabels) {
if (arcLabel != null) {
GrammaticalRelation reln2 = GrammaticalRelation.getRelation(arcLabel);
if (!list.isEmpty()) {
for (int i = 0; i < list.size(); i++) {
GrammaticalRelation gr = list.get(i);
//if the element in the list is an ancestor of the current relation, replace it
if (gr.isAncestor(reln2)) {
int index = list.indexOf(gr);
list.set(index, reln2);
}
//if the relation is not an ancestor of an element in the list, we add the relation
else if (!reln2.isAncestor(gr)) {
list.add(reln2);
}
}
} else {
list.add(reln2);
}
}
}
//System.out.println("in list " + list);
return list;
} | java | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.