code
stringlengths
73
34.1k
label
stringclasses
1 value
private static void loadFile(String filePath) { final Path path = FileSystems.getDefault().getPath(filePath); try { data.clear(); data.load(Files.newBufferedReader(path)); } catch(IOException e) { LOG.warn("Exception while loading " + path.toString(), e); } }
java
public void setValue(String constantValue) { this.fieldSource = SOURCE_VALUE; this.fieldRefName = null; this.returnedByProcedure = false; this.constantValue = constantValue; }
java
public final int getJdbcType() { switch (this.fieldSource) { case SOURCE_FIELD : return this.getFieldRef().getJdbcType().getType(); case SOURCE_NULL : return java.sql.Types.NULL; case SOURCE_VALUE : return java.sql.Types.VARCHAR; default : return java.sql.Types.NULL; } }
java
private boolean isCacheable(PipelineContext context) throws GeomajasException { VectorLayer layer = context.get(PipelineCode.LAYER_KEY, VectorLayer.class); return !(layer instanceof VectorLayerLazyFeatureConversionSupport && ((VectorLayerLazyFeatureConversionSupport) layer).useLazyFeatureConversion()); }
java
@Deprecated public List<Double> getResolutions() { List<Double> resolutions = new ArrayList<Double>(); for (ScaleInfo scale : getZoomLevels()) { resolutions.add(1. / scale.getPixelPerUnit()); } return resolutions; }
java
@Deprecated public void setResolutions(List<Double> resolutions) { getZoomLevels().clear(); for (Double resolution : resolutions) { getZoomLevels().add(new ScaleInfo(1. / resolution)); } }
java
public static void registerTinyTypes(Class<?> head, Class<?>... tail) { final Set<HeaderDelegateProvider> systemRegisteredHeaderProviders = stealAcquireRefToHeaderDelegateProviders(); register(head, systemRegisteredHeaderProviders); for (Class<?> tt : tail) { register(tt, systemRegisteredHeaderProviders); } }
java
public static String generateQuery(final Map<String,Object> params){ final StringBuilder sb = new StringBuilder(); boolean newEntry = false; sb.append("{"); for(final Entry<String,Object> param: params.entrySet()){ if(newEntry){ sb.append(", "); } sb.append(param.getKey()); sb.append(": "); sb.append(getParam(param.getValue())); newEntry = true; } sb.append("}"); return sb.toString(); }
java
public static String generateQuery(final String key, final Object value) { final Map<String, Object> params = new HashMap<>(); params.put(key, value); return generateQuery(params); }
java
private static Object getParam(final Object param) { final StringBuilder sb = new StringBuilder(); if(param instanceof String){ sb.append("'"); sb.append((String)param); sb.append("'"); } else if(param instanceof Boolean){ sb.append(String.valueOf((Boolean)param)); } else if(param instanceof Integer){ sb.append(String.valueOf((Integer)param)); } else if(param instanceof DBRegExp){ sb.append('/'); sb.append(((DBRegExp) param).toString()); sb.append('/'); } return sb.toString(); }
java
public static String getOjbClassName(ResultSet rs) { try { return rs.getString(OJB_CLASS_COLUMN); } catch (SQLException e) { return null; } }
java
public void setOjbQuery(org.apache.ojb.broker.query.Query ojbQuery) { this.ojbQuery = ojbQuery; }
java
@GET @Produces({MediaType.TEXT_HTML, MediaType.APPLICATION_JSON}) @Path("/{name}" + ServerAPI.GET_CORPORATE_GROUPIDS) public Response getCorporateGroupIdPrefix(@PathParam("name") final String organizationId){ LOG.info("Got a get corporate groupId prefix request for organization " + organizationId +"."); final ListView view = new ListView("Organization " + organizationId, "Corporate GroupId Prefix"); final List<String> corporateGroupIds = getOrganizationHandler().getCorporateGroupIds(organizationId); view.addAll(corporateGroupIds); return Response.ok(view).build(); }
java
@POST @Path("/{name}" + ServerAPI.GET_CORPORATE_GROUPIDS) public Response addCorporateGroupIdPrefix(@Auth final DbCredential credential, @PathParam("name") final String organizationId, final String corporateGroupId){ LOG.info("Got an add a corporate groupId prefix request for organization " + organizationId +"."); if(!credential.getRoles().contains(DbCredential.AvailableRoles.DATA_UPDATER)){ throw new WebApplicationException(Response.status(Response.Status.UNAUTHORIZED).build()); } if(corporateGroupId == null || corporateGroupId.isEmpty()){ LOG.error("No corporate GroupId to add!"); throw new WebApplicationException(Response.serverError().status(HttpStatus.BAD_REQUEST_400) .entity("CorporateGroupId to add should be in the query content.").build()); } getOrganizationHandler().addCorporateGroupId(organizationId, corporateGroupId); return Response.ok().status(HttpStatus.CREATED_201).build(); }
java
@DELETE @Path("/{name}" + ServerAPI.GET_CORPORATE_GROUPIDS) public Response removeCorporateGroupIdPrefix(@Auth final DbCredential credential, @PathParam("name") final String organizationId, final String corporateGroupId){ LOG.info("Got an remove a corporate groupId prefix request for organization " + organizationId +"."); if(!credential.getRoles().contains(DbCredential.AvailableRoles.DATA_UPDATER)){ throw new WebApplicationException(Response.status(Response.Status.UNAUTHORIZED).build()); } if(corporateGroupId == null || corporateGroupId.isEmpty()){ LOG.error("No corporate GroupId to remove!"); return Response.serverError().status(HttpStatus.BAD_REQUEST_400).build(); } getOrganizationHandler().removeCorporateGroupId(organizationId, corporateGroupId); return Response.ok("done").build(); }
java
private StyleFilter findStyleFilter(Object feature, List<StyleFilter> styles) { for (StyleFilter styleFilter : styles) { if (styleFilter.getFilter().evaluate(feature)) { return styleFilter; } } return new StyleFilterImpl(); }
java
final void roll(final long timeForSuffix) { final File backupFile = this.prepareBackupFile(timeForSuffix); // close filename this.getAppender().closeFile(); // rename filename on disk to filename+suffix(+number) this.doFileRoll(this.getAppender().getIoFile(), backupFile); // setup new file 'filename' this.getAppender().openFile(); this.fireFileRollEvent(new FileRollEvent(this, backupFile)); }
java
private void doFileRoll(final File from, final File to) { final FileHelper fileHelper = FileHelper.getInstance(); if (!fileHelper.deleteExisting(to)) { this.getAppender().getErrorHandler() .error("Unable to delete existing " + to + " for rename"); } final String original = from.toString(); if (fileHelper.rename(from, to)) { LogLog.debug("Renamed " + original + " to " + to); } else { this.getAppender().getErrorHandler() .error("Unable to rename " + original + " to " + to); } }
java
public static spilloverpolicy_lbvserver_binding[] get(nitro_service service, String name) throws Exception{ spilloverpolicy_lbvserver_binding obj = new spilloverpolicy_lbvserver_binding(); obj.set_name(name); spilloverpolicy_lbvserver_binding response[] = (spilloverpolicy_lbvserver_binding[]) obj.get_resources(service); return response; }
java
public static appfwprofile_excluderescontenttype_binding[] get(nitro_service service, String name) throws Exception{ appfwprofile_excluderescontenttype_binding obj = new appfwprofile_excluderescontenttype_binding(); obj.set_name(name); appfwprofile_excluderescontenttype_binding response[] = (appfwprofile_excluderescontenttype_binding[]) obj.get_resources(service); return response; }
java
public static base_response update(nitro_service client, sslparameter resource) throws Exception { sslparameter updateresource = new sslparameter(); updateresource.quantumsize = resource.quantumsize; updateresource.crlmemorysizemb = resource.crlmemorysizemb; updateresource.strictcachecks = resource.strictcachecks; updateresource.ssltriggertimeout = resource.ssltriggertimeout; updateresource.sendclosenotify = resource.sendclosenotify; updateresource.encrypttriggerpktcount = resource.encrypttriggerpktcount; updateresource.denysslreneg = resource.denysslreneg; updateresource.insertionencoding = resource.insertionencoding; updateresource.ocspcachesize = resource.ocspcachesize; updateresource.pushflag = resource.pushflag; updateresource.dropreqwithnohostheader = resource.dropreqwithnohostheader; updateresource.pushenctriggertimeout = resource.pushenctriggertimeout; updateresource.undefactioncontrol = resource.undefactioncontrol; updateresource.undefactiondata = resource.undefactiondata; return updateresource.update_resource(client); }
java
public static base_response unset(nitro_service client, sslparameter resource, String[] args) throws Exception{ sslparameter unsetresource = new sslparameter(); return unsetresource.unset_resource(client,args); }
java
public static sslparameter get(nitro_service service) throws Exception{ sslparameter obj = new sslparameter(); sslparameter[] response = (sslparameter[])obj.get_resources(service); return response[0]; }
java
public static base_response add(nitro_service client, spilloverpolicy resource) throws Exception { spilloverpolicy addresource = new spilloverpolicy(); addresource.name = resource.name; addresource.rule = resource.rule; addresource.action = resource.action; addresource.comment = resource.comment; return addresource.add_resource(client); }
java
public static base_response update(nitro_service client, spilloverpolicy resource) throws Exception { spilloverpolicy updateresource = new spilloverpolicy(); updateresource.name = resource.name; updateresource.rule = resource.rule; updateresource.action = resource.action; updateresource.comment = resource.comment; return updateresource.update_resource(client); }
java
public static spilloverpolicy[] get(nitro_service service, options option) throws Exception{ spilloverpolicy obj = new spilloverpolicy(); spilloverpolicy[] response = (spilloverpolicy[])obj.get_resources(service,option); return response; }
java
public static spilloverpolicy get(nitro_service service, String name) throws Exception{ spilloverpolicy obj = new spilloverpolicy(); obj.set_name(name); spilloverpolicy response = (spilloverpolicy) obj.get_resource(service); return response; }
java
public static <IN> PaddedList<IN> valueOf(List<IN> list, IN padding) { return new PaddedList<IN>(list, padding); }
java
public static base_response add(nitro_service client, locationfile resource) throws Exception { locationfile addresource = new locationfile(); addresource.Locationfile = resource.Locationfile; addresource.format = resource.format; return addresource.add_resource(client); }
java
public static base_response delete(nitro_service client) throws Exception { locationfile deleteresource = new locationfile(); return deleteresource.delete_resource(client); }
java
public static locationfile get(nitro_service service) throws Exception{ locationfile obj = new locationfile(); locationfile[] response = (locationfile[])obj.get_resources(service); return response[0]; }
java
public static sslcertkey_sslocspresponder_binding[] get(nitro_service service, String certkey) throws Exception{ sslcertkey_sslocspresponder_binding obj = new sslcertkey_sslocspresponder_binding(); obj.set_certkey(certkey); sslcertkey_sslocspresponder_binding response[] = (sslcertkey_sslocspresponder_binding[]) obj.get_resources(service); return response; }
java
public static appflowpolicy_appflowpolicylabel_binding[] get(nitro_service service, String name) throws Exception{ appflowpolicy_appflowpolicylabel_binding obj = new appflowpolicy_appflowpolicylabel_binding(); obj.set_name(name); appflowpolicy_appflowpolicylabel_binding response[] = (appflowpolicy_appflowpolicylabel_binding[]) obj.get_resources(service); return response; }
java
public static authenticationvserver_authenticationnegotiatepolicy_binding[] get(nitro_service service, String name) throws Exception{ authenticationvserver_authenticationnegotiatepolicy_binding obj = new authenticationvserver_authenticationnegotiatepolicy_binding(); obj.set_name(name); authenticationvserver_authenticationnegotiatepolicy_binding response[] = (authenticationvserver_authenticationnegotiatepolicy_binding[]) obj.get_resources(service); return response; }
java
public static base_response update(nitro_service client, rnatparam resource) throws Exception { rnatparam updateresource = new rnatparam(); updateresource.tcpproxy = resource.tcpproxy; return updateresource.update_resource(client); }
java
public static base_response unset(nitro_service client, rnatparam resource, String[] args) throws Exception{ rnatparam unsetresource = new rnatparam(); return unsetresource.unset_resource(client,args); }
java
public static rnatparam get(nitro_service service) throws Exception{ rnatparam obj = new rnatparam(); rnatparam[] response = (rnatparam[])obj.get_resources(service); return response[0]; }
java
public static base_response update(nitro_service client, nd6ravariables resource) throws Exception { nd6ravariables updateresource = new nd6ravariables(); updateresource.vlan = resource.vlan; updateresource.ceaserouteradv = resource.ceaserouteradv; updateresource.sendrouteradv = resource.sendrouteradv; updateresource.srclinklayeraddroption = resource.srclinklayeraddroption; updateresource.onlyunicastrtadvresponse = resource.onlyunicastrtadvresponse; updateresource.managedaddrconfig = resource.managedaddrconfig; updateresource.otheraddrconfig = resource.otheraddrconfig; updateresource.currhoplimit = resource.currhoplimit; updateresource.maxrtadvinterval = resource.maxrtadvinterval; updateresource.minrtadvinterval = resource.minrtadvinterval; updateresource.linkmtu = resource.linkmtu; updateresource.reachabletime = resource.reachabletime; updateresource.retranstime = resource.retranstime; updateresource.defaultlifetime = resource.defaultlifetime; return updateresource.update_resource(client); }
java
public static base_responses update(nitro_service client, nd6ravariables resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { nd6ravariables updateresources[] = new nd6ravariables[resources.length]; for (int i=0;i<resources.length;i++){ updateresources[i] = new nd6ravariables(); updateresources[i].vlan = resources[i].vlan; updateresources[i].ceaserouteradv = resources[i].ceaserouteradv; updateresources[i].sendrouteradv = resources[i].sendrouteradv; updateresources[i].srclinklayeraddroption = resources[i].srclinklayeraddroption; updateresources[i].onlyunicastrtadvresponse = resources[i].onlyunicastrtadvresponse; updateresources[i].managedaddrconfig = resources[i].managedaddrconfig; updateresources[i].otheraddrconfig = resources[i].otheraddrconfig; updateresources[i].currhoplimit = resources[i].currhoplimit; updateresources[i].maxrtadvinterval = resources[i].maxrtadvinterval; updateresources[i].minrtadvinterval = resources[i].minrtadvinterval; updateresources[i].linkmtu = resources[i].linkmtu; updateresources[i].reachabletime = resources[i].reachabletime; updateresources[i].retranstime = resources[i].retranstime; updateresources[i].defaultlifetime = resources[i].defaultlifetime; } result = update_bulk_request(client, updateresources); } return result; }
java
public static nd6ravariables[] get(nitro_service service, options option) throws Exception{ nd6ravariables obj = new nd6ravariables(); nd6ravariables[] response = (nd6ravariables[])obj.get_resources(service,option); return response; }
java
public static nd6ravariables get(nitro_service service, Long vlan) throws Exception{ nd6ravariables obj = new nd6ravariables(); obj.set_vlan(vlan); nd6ravariables response = (nd6ravariables) obj.get_resource(service); return response; }
java
public static nd6ravariables[] get(nitro_service service, Long vlan[]) throws Exception{ if (vlan !=null && vlan.length>0) { nd6ravariables response[] = new nd6ravariables[vlan.length]; nd6ravariables obj[] = new nd6ravariables[vlan.length]; for (int i=0;i<vlan.length;i++) { obj[i] = new nd6ravariables(); obj[i].set_vlan(vlan[i]); response[i] = (nd6ravariables) obj[i].get_resource(service); } return response; } return null; }
java
public static gslbrunningconfig get(nitro_service service) throws Exception{ gslbrunningconfig obj = new gslbrunningconfig(); gslbrunningconfig[] response = (gslbrunningconfig[])obj.get_resources(service); return response[0]; }
java
public static base_response update(nitro_service client, callhome resource) throws Exception { callhome updateresource = new callhome(); updateresource.emailaddress = resource.emailaddress; updateresource.proxymode = resource.proxymode; updateresource.ipaddress = resource.ipaddress; updateresource.port = resource.port; return updateresource.update_resource(client); }
java
public static base_response unset(nitro_service client, callhome resource, String[] args) throws Exception{ callhome unsetresource = new callhome(); return unsetresource.unset_resource(client,args); }
java
public static callhome get(nitro_service service) throws Exception{ callhome obj = new callhome(); callhome[] response = (callhome[])obj.get_resources(service); return response[0]; }
java
public static csvserver_appflowpolicy_binding[] get(nitro_service service, String name) throws Exception{ csvserver_appflowpolicy_binding obj = new csvserver_appflowpolicy_binding(); obj.set_name(name); csvserver_appflowpolicy_binding response[] = (csvserver_appflowpolicy_binding[]) obj.get_resources(service); return response; }
java
public static cachepolicy_cacheglobal_binding[] get(nitro_service service, String policyname) throws Exception{ cachepolicy_cacheglobal_binding obj = new cachepolicy_cacheglobal_binding(); obj.set_policyname(policyname); cachepolicy_cacheglobal_binding response[] = (cachepolicy_cacheglobal_binding[]) obj.get_resources(service); return response; }
java
public static sslglobal_sslpolicy_binding[] get(nitro_service service) throws Exception{ sslglobal_sslpolicy_binding obj = new sslglobal_sslpolicy_binding(); sslglobal_sslpolicy_binding response[] = (sslglobal_sslpolicy_binding[]) obj.get_resources(service); return response; }
java
public static sslglobal_sslpolicy_binding[] get_filtered(nitro_service service, filtervalue[] filter) throws Exception{ sslglobal_sslpolicy_binding obj = new sslglobal_sslpolicy_binding(); options option = new options(); option.set_filter(filter); sslglobal_sslpolicy_binding[] response = (sslglobal_sslpolicy_binding[]) obj.getfiltered(service, option); return response; }
java
public Collection<V> put(K key, Collection<V> collection) { return map.put(key, collection); }
java
public void add(K key, V value) { if (treatCollectionsAsImmutable) { Collection<V> newC = cf.newCollection(); Collection<V> c = map.get(key); if (c != null) { newC.addAll(c); } newC.add(value); map.put(key, newC); // replacing the old collection } else { Collection<V> c = map.get(key); if (c == null) { c = cf.newCollection(); map.put(key, c); } c.add(value); // modifying the old collection } }
java
public void removeMapping(K key, V value) { if (treatCollectionsAsImmutable) { Collection<V> c = map.get(key); if (c != null) { Collection<V> newC = cf.newCollection(); newC.addAll(c); newC.remove(value); map.put(key, newC); } } else { Collection<V> c = get(key); c.remove(value); } }
java
public CollectionValuedMap<K, V> deltaClone() { CollectionValuedMap<K, V> result = new CollectionValuedMap<K, V>(null, cf, true); result.map = new DeltaMap<K, Collection<V>>(this.map); return result; }
java
public static linkset_interface_binding[] get(nitro_service service, String id) throws Exception{ linkset_interface_binding obj = new linkset_interface_binding(); obj.set_id(id); linkset_interface_binding response[] = (linkset_interface_binding[]) obj.get_resources(service); return response; }
java
public static long count(nitro_service service, String id) throws Exception{ linkset_interface_binding obj = new linkset_interface_binding(); obj.set_id(id); options option = new options(); option.set_count(true); linkset_interface_binding response[] = (linkset_interface_binding[]) obj.get_resources(service,option); if (response != null) { return response[0].__count; } return 0; }
java
public static tmtrafficpolicy_lbvserver_binding[] get(nitro_service service, String name) throws Exception{ tmtrafficpolicy_lbvserver_binding obj = new tmtrafficpolicy_lbvserver_binding(); obj.set_name(name); tmtrafficpolicy_lbvserver_binding response[] = (tmtrafficpolicy_lbvserver_binding[]) obj.get_resources(service); return response; }
java
public static vlan_interface_binding[] get(nitro_service service, Long id) throws Exception{ vlan_interface_binding obj = new vlan_interface_binding(); obj.set_id(id); vlan_interface_binding response[] = (vlan_interface_binding[]) obj.get_resources(service); return response; }
java
public static rewritepolicy_csvserver_binding[] get(nitro_service service, String name) throws Exception{ rewritepolicy_csvserver_binding obj = new rewritepolicy_csvserver_binding(); obj.set_name(name); rewritepolicy_csvserver_binding response[] = (rewritepolicy_csvserver_binding[]) obj.get_resources(service); return response; }
java
public static tunneltrafficpolicy[] get(nitro_service service, options option) throws Exception{ tunneltrafficpolicy obj = new tunneltrafficpolicy(); tunneltrafficpolicy[] response = (tunneltrafficpolicy[])obj.get_resources(service,option); return response; }
java
public static tunneltrafficpolicy get(nitro_service service, String name) throws Exception{ tunneltrafficpolicy obj = new tunneltrafficpolicy(); obj.set_name(name); tunneltrafficpolicy response = (tunneltrafficpolicy) obj.get_resource(service); return response; }
java
public static vpnglobal_intranetip_binding[] get(nitro_service service) throws Exception{ vpnglobal_intranetip_binding obj = new vpnglobal_intranetip_binding(); vpnglobal_intranetip_binding response[] = (vpnglobal_intranetip_binding[]) obj.get_resources(service); return response; }
java
public static base_response add(nitro_service client, sslaction resource) throws Exception { sslaction addresource = new sslaction(); addresource.name = resource.name; addresource.clientauth = resource.clientauth; addresource.clientcert = resource.clientcert; addresource.certheader = resource.certheader; addresource.clientcertserialnumber = resource.clientcertserialnumber; addresource.certserialheader = resource.certserialheader; addresource.clientcertsubject = resource.clientcertsubject; addresource.certsubjectheader = resource.certsubjectheader; addresource.clientcerthash = resource.clientcerthash; addresource.certhashheader = resource.certhashheader; addresource.clientcertissuer = resource.clientcertissuer; addresource.certissuerheader = resource.certissuerheader; addresource.sessionid = resource.sessionid; addresource.sessionidheader = resource.sessionidheader; addresource.cipher = resource.cipher; addresource.cipherheader = resource.cipherheader; addresource.clientcertnotbefore = resource.clientcertnotbefore; addresource.certnotbeforeheader = resource.certnotbeforeheader; addresource.clientcertnotafter = resource.clientcertnotafter; addresource.certnotafterheader = resource.certnotafterheader; addresource.owasupport = resource.owasupport; return addresource.add_resource(client); }
java
public static base_responses add(nitro_service client, sslaction resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { sslaction addresources[] = new sslaction[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new sslaction(); addresources[i].name = resources[i].name; addresources[i].clientauth = resources[i].clientauth; addresources[i].clientcert = resources[i].clientcert; addresources[i].certheader = resources[i].certheader; addresources[i].clientcertserialnumber = resources[i].clientcertserialnumber; addresources[i].certserialheader = resources[i].certserialheader; addresources[i].clientcertsubject = resources[i].clientcertsubject; addresources[i].certsubjectheader = resources[i].certsubjectheader; addresources[i].clientcerthash = resources[i].clientcerthash; addresources[i].certhashheader = resources[i].certhashheader; addresources[i].clientcertissuer = resources[i].clientcertissuer; addresources[i].certissuerheader = resources[i].certissuerheader; addresources[i].sessionid = resources[i].sessionid; addresources[i].sessionidheader = resources[i].sessionidheader; addresources[i].cipher = resources[i].cipher; addresources[i].cipherheader = resources[i].cipherheader; addresources[i].clientcertnotbefore = resources[i].clientcertnotbefore; addresources[i].certnotbeforeheader = resources[i].certnotbeforeheader; addresources[i].clientcertnotafter = resources[i].clientcertnotafter; addresources[i].certnotafterheader = resources[i].certnotafterheader; addresources[i].owasupport = resources[i].owasupport; } result = add_bulk_request(client, addresources); } return result; }
java
public static sslaction[] get(nitro_service service) throws Exception{ sslaction obj = new sslaction(); sslaction[] response = (sslaction[])obj.get_resources(service); return response; }
java
public static sslaction get(nitro_service service, String name) throws Exception{ sslaction obj = new sslaction(); obj.set_name(name); sslaction response = (sslaction) obj.get_resource(service); return response; }
java
public static rewriteglobal_binding get(nitro_service service) throws Exception{ rewriteglobal_binding obj = new rewriteglobal_binding(); rewriteglobal_binding response = (rewriteglobal_binding) obj.get_resource(service); return response; }
java
public static vpath_stats get(nitro_service service) throws Exception{ vpath_stats obj = new vpath_stats(); vpath_stats[] response = (vpath_stats[])obj.stat_resources(service); return response[0]; }
java
public static aaauser_auditsyslogpolicy_binding[] get(nitro_service service, String username) throws Exception{ aaauser_auditsyslogpolicy_binding obj = new aaauser_auditsyslogpolicy_binding(); obj.set_username(username); aaauser_auditsyslogpolicy_binding response[] = (aaauser_auditsyslogpolicy_binding[]) obj.get_resources(service); return response; }
java
public static lbvserver_cachepolicy_binding[] get(nitro_service service, String name) throws Exception{ lbvserver_cachepolicy_binding obj = new lbvserver_cachepolicy_binding(); obj.set_name(name); lbvserver_cachepolicy_binding response[] = (lbvserver_cachepolicy_binding[]) obj.get_resources(service); return response; }
java
public static tunnelip_stats[] get(nitro_service service) throws Exception{ tunnelip_stats obj = new tunnelip_stats(); tunnelip_stats[] response = (tunnelip_stats[])obj.stat_resources(service); return response; }
java
public static tunnelip_stats get(nitro_service service, String tunnelip) throws Exception{ tunnelip_stats obj = new tunnelip_stats(); obj.set_tunnelip(tunnelip); tunnelip_stats response = (tunnelip_stats) obj.stat_resource(service); return response; }
java
public void updateSequenceElement(int[] sequence, int pos, int oldVal) { if(models != null){ for(int i = 0; i < models.length; i++) models[i].updateSequenceElement(sequence, pos, oldVal); return; } model1.updateSequenceElement(sequence, pos, 0); model2.updateSequenceElement(sequence, pos, 0); }
java
public void setInitialSequence(int[] sequence) { if(models != null){ for(int i = 0; i < models.length; i++) models[i].setInitialSequence(sequence); return; } model1.setInitialSequence(sequence); model2.setInitialSequence(sequence); }
java
public static <T> IteratorFromReaderFactory<T> getFactory(String delim, Function<String,T> op) { return new DelimitRegExIteratorFactory<T>(delim, op); }
java
public static lbmonbindings_servicegroup_binding[] get(nitro_service service, String monitorname) throws Exception{ lbmonbindings_servicegroup_binding obj = new lbmonbindings_servicegroup_binding(); obj.set_monitorname(monitorname); lbmonbindings_servicegroup_binding response[] = (lbmonbindings_servicegroup_binding[]) obj.get_resources(service); return response; }
java
public final List<MtasSolrStatus> checkForExceptions() { List<MtasSolrStatus> statusWithException = null; for (MtasSolrStatus item : data) { if (item.checkResponseForException()) { if (statusWithException == null) { statusWithException = new ArrayList<>(); } statusWithException.add(item); } } return statusWithException; }
java
public static authenticationradiuspolicy_authenticationvserver_binding[] get(nitro_service service, String name) throws Exception{ authenticationradiuspolicy_authenticationvserver_binding obj = new authenticationradiuspolicy_authenticationvserver_binding(); obj.set_name(name); authenticationradiuspolicy_authenticationvserver_binding response[] = (authenticationradiuspolicy_authenticationvserver_binding[]) obj.get_resources(service); return response; }
java
public static vpnvserver_authenticationsamlpolicy_binding[] get(nitro_service service, String name) throws Exception{ vpnvserver_authenticationsamlpolicy_binding obj = new vpnvserver_authenticationsamlpolicy_binding(); obj.set_name(name); vpnvserver_authenticationsamlpolicy_binding response[] = (vpnvserver_authenticationsamlpolicy_binding[]) obj.get_resources(service); return response; }
java
public static base_response convert(nitro_service client, sslpkcs8 resource) throws Exception { sslpkcs8 convertresource = new sslpkcs8(); convertresource.pkcs8file = resource.pkcs8file; convertresource.keyfile = resource.keyfile; convertresource.keyform = resource.keyform; convertresource.password = resource.password; return convertresource.perform_operation(client,"convert"); }
java
public static ci[] get(nitro_service service) throws Exception{ ci obj = new ci(); ci[] response = (ci[])obj.get_resources(service); return response; }
java
public static base_response add(nitro_service client, sslcipher resource) throws Exception { sslcipher addresource = new sslcipher(); addresource.ciphergroupname = resource.ciphergroupname; addresource.ciphgrpalias = resource.ciphgrpalias; return addresource.add_resource(client); }
java
public static base_responses add(nitro_service client, sslcipher resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { sslcipher addresources[] = new sslcipher[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new sslcipher(); addresources[i].ciphergroupname = resources[i].ciphergroupname; addresources[i].ciphgrpalias = resources[i].ciphgrpalias; } result = add_bulk_request(client, addresources); } return result; }
java
public static base_response delete(nitro_service client, String ciphergroupname) throws Exception { sslcipher deleteresource = new sslcipher(); deleteresource.ciphergroupname = ciphergroupname; return deleteresource.delete_resource(client); }
java
public static base_responses delete(nitro_service client, String ciphergroupname[]) throws Exception { base_responses result = null; if (ciphergroupname != null && ciphergroupname.length > 0) { sslcipher deleteresources[] = new sslcipher[ciphergroupname.length]; for (int i=0;i<ciphergroupname.length;i++){ deleteresources[i] = new sslcipher(); deleteresources[i].ciphergroupname = ciphergroupname[i]; } result = delete_bulk_request(client, deleteresources); } return result; }
java
public static sslcipher[] get(nitro_service service) throws Exception{ sslcipher obj = new sslcipher(); sslcipher[] response = (sslcipher[])obj.get_resources(service); return response; }
java
public static sslcipher get(nitro_service service, String ciphergroupname) throws Exception{ sslcipher obj = new sslcipher(); obj.set_ciphergroupname(ciphergroupname); sslcipher response = (sslcipher) obj.get_resource(service); return response; }
java
public static sslcipher[] get(nitro_service service, String ciphergroupname[]) throws Exception{ if (ciphergroupname !=null && ciphergroupname.length>0) { sslcipher response[] = new sslcipher[ciphergroupname.length]; sslcipher obj[] = new sslcipher[ciphergroupname.length]; for (int i=0;i<ciphergroupname.length;i++) { obj[i] = new sslcipher(); obj[i].set_ciphergroupname(ciphergroupname[i]); response[i] = (sslcipher) obj[i].get_resource(service); } return response; } return null; }
java
public static base_response add(nitro_service client, transformpolicy resource) throws Exception { transformpolicy addresource = new transformpolicy(); addresource.name = resource.name; addresource.rule = resource.rule; addresource.profilename = resource.profilename; addresource.comment = resource.comment; addresource.logaction = resource.logaction; return addresource.add_resource(client); }
java
public static base_response update(nitro_service client, transformpolicy resource) throws Exception { transformpolicy updateresource = new transformpolicy(); updateresource.name = resource.name; updateresource.rule = resource.rule; updateresource.profilename = resource.profilename; updateresource.comment = resource.comment; updateresource.logaction = resource.logaction; return updateresource.update_resource(client); }
java
public static transformpolicy[] get(nitro_service service) throws Exception{ transformpolicy obj = new transformpolicy(); transformpolicy[] response = (transformpolicy[])obj.get_resources(service); return response; }
java
public static transformpolicy get(nitro_service service, String name) throws Exception{ transformpolicy obj = new transformpolicy(); obj.set_name(name); transformpolicy response = (transformpolicy) obj.get_resource(service); return response; }
java
public int compareTo(WordTag wordTag) { int first = (word != null ? word().compareTo(wordTag.word()) : 0); if(first != 0) return first; else { if (tag() == null) { if (wordTag.tag() == null) return 0; else return -1; } return tag().compareTo(wordTag.tag()); } }
java
protected void rehash(int newCapacity) { int oldCapacity = table.length; //if (oldCapacity == newCapacity) return; long oldTable[] = table; int oldValues[] = values; byte oldState[] = state; long newTable[] = new long[newCapacity]; int newValues[] = new int[newCapacity]; byte newState[] = new byte[newCapacity]; this.lowWaterMark = chooseLowWaterMark(newCapacity,this.minLoadFactor); this.highWaterMark = chooseHighWaterMark(newCapacity,this.maxLoadFactor); this.table = newTable; this.values = newValues; this.state = newState; this.freeEntries = newCapacity-this.distinct; // delta for (int i = oldCapacity ; i-- > 0 ;) { if (oldState[i]==FULL) { long element = oldTable[i]; int index = indexOfInsertion(element); newTable[index]=element; newValues[index]=oldValues[i]; newState[index]=FULL; } } }
java
public boolean removeKey(long key) { int i = indexOfKey(key); if (i<0) return false; // key not contained this.state[i]=REMOVED; this.values[i]=0; // delta this.distinct--; if (this.distinct < this.lowWaterMark) { int newCapacity = chooseShrinkCapacity(this.distinct,this.minLoadFactor, this.maxLoadFactor); rehash(newCapacity); } return true; }
java
public static DocumentBuilder getXmlParser() { DocumentBuilder db = null; try { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setValidating(false); //Disable DTD loading and validation //See http://stackoverflow.com/questions/155101/make-documentbuilder-parse-ignore-dtd-references dbf.setFeature("http://apache.org/xml/features/nonvalidating/load-dtd-grammar", false); dbf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); db = dbf.newDocumentBuilder(); db.setErrorHandler(new SAXErrorHandler()); } catch (ParserConfigurationException e) { System.err.printf("%s: Unable to create XML parser\n", XMLUtils.class.getName()); e.printStackTrace(); } catch(UnsupportedOperationException e) { System.err.printf("%s: API error while setting up XML parser. Check your JAXP version\n", XMLUtils.class.getName()); e.printStackTrace(); } return db; }
java
public static String readUntilTag(Reader r) throws IOException { if (!r.ready()) { return ""; } StringBuilder b = new StringBuilder(); int c = r.read(); while (c >= 0 && c != '<') { b.append((char) c); c = r.read(); } return b.toString(); }
java
public static int findSpace(String haystack, int begin) { int space = haystack.indexOf(' ', begin); int nbsp = haystack.indexOf('\u00A0', begin); if (space == -1 && nbsp == -1) { return -1; } else if (space >= 0 && nbsp >= 0) { return Math.min(space, nbsp); } else { // eg one is -1, and the other is >= 0 return Math.max(space, nbsp); } }
java
public static String readTag(Reader r) throws IOException { if ( ! r.ready()) { return null; } StringBuilder b = new StringBuilder("<"); int c = r.read(); while (c >= 0) { b.append((char) c); if (c == '>') { break; } c = r.read(); } if (b.length() == 1) { return null; } return b.toString(); }
java
public static Document readDocumentFromString(String s) throws Exception { InputSource in = new InputSource(new StringReader(s)); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setNamespaceAware(false); return factory.newDocumentBuilder().parse(in); }
java