idx
int64
0
41.2k
question
stringlengths
74
4.04k
target
stringlengths
7
750
3,100
public static appqoecustomresp [ ] get ( nitro_service service , options option ) throws Exception { appqoecustomresp obj = new appqoecustomresp ( ) ; appqoecustomresp [ ] response = ( appqoecustomresp [ ] ) obj . get_resources ( service , option ) ; return response ; }
Use this API to fetch all the appqoecustomresp resources that are configured on netscaler .
3,101
@ SuppressWarnings ( "unchecked" ) public static CodecInfo getCodecInfoFromTerms ( Terms t ) throws IOException { try { HashMap < String , IndexInput > indexInputList = null ; HashMap < String , Long > indexInputOffsetList = null ; Object version = null ; Method [ ] methods = t . getClass ( ) . getMethods ( ) ; Object [ ] emptyArgs = null ; for ( Method m : methods ) { if ( m . getName ( ) . equals ( "getIndexInputList" ) ) { indexInputList = ( HashMap < String , IndexInput > ) m . invoke ( t , emptyArgs ) ; } else if ( m . getName ( ) . equals ( "getIndexInputOffsetList" ) ) { indexInputOffsetList = ( HashMap < String , Long > ) m . invoke ( t , emptyArgs ) ; } else if ( m . getName ( ) . equals ( "getVersion" ) ) { version = m . invoke ( t , emptyArgs ) ; } } if ( indexInputList == null || indexInputOffsetList == null || version == null ) { throw new IOException ( "Reader doesn't provide MtasFieldsProducer" ) ; } else { return new CodecInfo ( indexInputList , indexInputOffsetList , ( int ) version ) ; } } catch ( IllegalAccessException | InvocationTargetException e ) { throw new IOException ( "Can't get codecInfo" , e ) ; } }
Gets the codec info from terms .
3,102
public MtasToken getObjectById ( String field , int docId , int mtasId ) throws IOException { try { Long ref ; Long objectRefApproxCorrection ; IndexDoc doc = getDoc ( field , docId ) ; IndexInput inObjectId = indexInputList . get ( "indexObjectId" ) ; IndexInput inObject = indexInputList . get ( "object" ) ; IndexInput inTerm = indexInputList . get ( "term" ) ; if ( doc . storageFlags == MtasCodecPostingsFormat . MTAS_STORAGE_BYTE ) { inObjectId . seek ( doc . fpIndexObjectId + ( mtasId * 1L ) ) ; objectRefApproxCorrection = Long . valueOf ( inObjectId . readByte ( ) ) ; } else if ( doc . storageFlags == MtasCodecPostingsFormat . MTAS_STORAGE_SHORT ) { inObjectId . seek ( doc . fpIndexObjectId + ( mtasId * 2L ) ) ; objectRefApproxCorrection = Long . valueOf ( inObjectId . readShort ( ) ) ; } else if ( doc . storageFlags == MtasCodecPostingsFormat . MTAS_STORAGE_INTEGER ) { inObjectId . seek ( doc . fpIndexObjectId + ( mtasId * 4L ) ) ; objectRefApproxCorrection = Long . valueOf ( inObjectId . readInt ( ) ) ; } else { inObjectId . seek ( doc . fpIndexObjectId + ( mtasId * 8L ) ) ; objectRefApproxCorrection = Long . valueOf ( inObjectId . readLong ( ) ) ; } ref = objectRefApproxCorrection + doc . objectRefApproxOffset + ( mtasId * ( long ) doc . objectRefApproxQuotient ) ; return MtasCodecPostingsFormat . getToken ( inObject , inTerm , ref ) ; } catch ( Exception e ) { throw new IOException ( e ) ; } }
Gets the object by id .
3,103
public List < MtasTokenString > getObjectsByParentId ( String field , int docId , int position ) throws IOException { IndexDoc doc = getDoc ( field , docId ) ; IndexInput inIndexObjectParent = indexInputList . get ( "indexObjectParent" ) ; ArrayList < MtasTreeHit < ? > > hits = CodecSearchTree . searchMtasTree ( position , inIndexObjectParent , doc . fpIndexObjectParent , doc . smallestObjectFilepointer ) ; return getObjects ( hits ) ; }
Gets the objects by parent id .
3,104
public ArrayList < MtasTokenString > getObjectsByPosition ( String field , int docId , int position ) throws IOException { IndexDoc doc = getDoc ( field , docId ) ; IndexInput inIndexObjectPosition = indexInputList . get ( "indexObjectPosition" ) ; ArrayList < MtasTreeHit < ? > > hits = CodecSearchTree . searchMtasTree ( position , inIndexObjectPosition , doc . fpIndexObjectPosition , doc . smallestObjectFilepointer ) ; return getObjects ( hits ) ; }
Gets the objects by position .
3,105
public List < MtasTokenString > getPrefixFilteredObjectsByPositions ( String field , int docId , List < String > prefixes , int startPosition , int endPosition ) throws IOException { IndexDoc doc = getDoc ( field , docId ) ; IndexInput inIndexObjectPosition = indexInputList . get ( "indexObjectPosition" ) ; if ( doc != null ) { ArrayList < MtasTreeHit < ? > > hits = CodecSearchTree . searchMtasTree ( startPosition , endPosition , inIndexObjectPosition , doc . fpIndexObjectPosition , doc . smallestObjectFilepointer ) ; return getPrefixFilteredObjects ( hits , prefixes ) ; } else { return new ArrayList < > ( ) ; } }
Gets the prefix filtered objects by positions .
3,106
private List < MtasTokenString > getPrefixFilteredObjects ( List < MtasTreeHit < ? > > hits , List < String > prefixes ) throws IOException { ArrayList < MtasTokenString > tokens = new ArrayList < > ( ) ; IndexInput inObject = indexInputList . get ( "object" ) ; IndexInput inTerm = indexInputList . get ( "term" ) ; for ( MtasTreeHit < ? > hit : hits ) { MtasTokenString token = MtasCodecPostingsFormat . getToken ( inObject , inTerm , hit . ref ) ; if ( token != null ) { if ( prefixes != null && ! prefixes . isEmpty ( ) ) { if ( prefixes . contains ( token . getPrefix ( ) ) ) { tokens . add ( token ) ; } } else { tokens . add ( token ) ; } } } return tokens ; }
Gets the prefix filtered objects .
3,107
public List < MtasTreeHit < String > > getPositionedTermsByPrefixesAndPosition ( String field , int docId , List < String > prefixes , int position ) throws IOException { return getPositionedTermsByPrefixesAndPositionRange ( field , docId , prefixes , position , position ) ; }
Gets the positioned terms by prefixes and position .
3,108
public List < MtasTreeHit < String > > getPositionedTermsByPrefixesAndPositionRange ( String field , int docId , List < String > prefixes , int startPosition , int endPosition ) throws IOException { IndexDoc doc = getDoc ( field , docId ) ; IndexInput inIndexObjectPosition = indexInputList . get ( "indexObjectPosition" ) ; if ( doc != null ) { ArrayList < MtasTreeHit < ? > > hitItems = CodecSearchTree . searchMtasTree ( startPosition , endPosition , inIndexObjectPosition , doc . fpIndexObjectPosition , doc . smallestObjectFilepointer ) ; List < MtasTreeHit < String > > hits = new ArrayList < > ( ) ; Map < String , Integer > prefixIds = getPrefixesIds ( field , prefixes ) ; if ( prefixIds != null && prefixIds . size ( ) > 0 ) { ArrayList < MtasTreeHit < ? > > filteredHitItems = new ArrayList < MtasTreeHit < ? > > ( ) ; for ( MtasTreeHit < ? > hitItem : hitItems ) { if ( prefixIds . containsValue ( hitItem . additionalId ) ) { filteredHitItems . add ( hitItem ) ; } } if ( filteredHitItems . size ( ) > 0 ) { ArrayList < MtasTokenString > objects = getObjects ( filteredHitItems ) ; for ( MtasTokenString token : objects ) { MtasTreeHit < String > hit = new MtasTreeHit < String > ( token . getPositionStart ( ) , token . getPositionEnd ( ) , token . getTokenRef ( ) , 0 , 0 , token . getValue ( ) ) ; hits . add ( hit ) ; } } } return hits ; } else { return new ArrayList < MtasTreeHit < String > > ( ) ; } }
Gets the positioned terms by prefixes and position range .
3,109
public void collectTermsByPrefixesForListOfHitPositions ( String field , int docId , ArrayList < String > prefixes , ArrayList < IntervalTreeNodeData < String > > positionsHits ) throws IOException { IndexDoc doc = getDoc ( field , docId ) ; IndexInput inIndexObjectPosition = indexInputList . get ( "indexObjectPosition" ) ; IndexInput inTerm = indexInputList . get ( "term" ) ; IntervalRBTree < String > positionTree = new IntervalRBTree < String > ( positionsHits ) ; Map < String , Integer > prefixIds = getPrefixesIds ( field , prefixes ) ; if ( prefixIds != null ) { CodecSearchTree . searchMtasTreeWithIntervalTree ( prefixIds . values ( ) , positionTree , inIndexObjectPosition , doc . fpIndexObjectPosition , doc . smallestObjectFilepointer ) ; Map < Integer , String > idPrefixes = new HashMap < > ( ) ; for ( Entry < String , Integer > entry : prefixIds . entrySet ( ) ) { idPrefixes . put ( entry . getValue ( ) , entry . getKey ( ) ) ; } Map < Long , String > refTerms = new HashMap < > ( ) ; for ( IntervalTreeNodeData < String > positionHit : positionsHits ) { for ( MtasTreeHit < String > hit : positionHit . list ) { if ( hit . idData == null ) { hit . idData = idPrefixes . get ( hit . additionalId ) ; if ( ! refTerms . containsKey ( hit . additionalRef ) ) { refTerms . put ( hit . additionalRef , MtasCodecPostingsFormat . getTerm ( inTerm , hit . additionalRef ) ) ; } hit . refData = refTerms . get ( hit . additionalRef ) ; } } } } }
Collect terms by prefixes for list of hit positions .
3,110
public ArrayList < MtasTreeHit < String > > getTerms ( ArrayList < MtasTreeHit < ? > > refs ) throws IOException { try { ArrayList < MtasTreeHit < String > > terms = new ArrayList < MtasTreeHit < String > > ( ) ; IndexInput inTerm = indexInputList . get ( "term" ) ; for ( MtasTreeHit < ? > hit : refs ) { inTerm . seek ( hit . ref ) ; String term = inTerm . readString ( ) ; MtasTreeHit < String > newHit = new MtasTreeHit < String > ( hit . startPosition , hit . endPosition , hit . ref , hit . additionalId , hit . additionalRef , term ) ; terms . add ( newHit ) ; } return terms ; } catch ( Exception e ) { throw new IOException ( e ) ; } }
Gets the terms .
3,111
Map < String , Integer > getPrefixesIds ( String field , List < String > prefixes ) { LinkedHashMap < String , Long > refs = getPrefixRefs ( field ) ; if ( refs != null ) { List < String > list = new ArrayList < > ( refs . keySet ( ) ) ; Map < String , Integer > result = new HashMap < > ( ) ; for ( String prefix : prefixes ) { int id = list . indexOf ( prefix ) ; if ( id >= 0 ) { result . put ( prefix , id + 1 ) ; } } return result ; } else { return null ; } }
Gets the prefixes ids .
3,112
private LinkedHashMap < String , Long > getPrefixRefs ( String field ) { if ( fieldReferences . containsKey ( field ) ) { FieldReferences fr = fieldReferences . get ( field ) ; if ( ! prefixReferences . containsKey ( field ) ) { LinkedHashMap < String , Long > refs = new LinkedHashMap < String , Long > ( ) ; try { IndexInput inPrefix = indexInputList . get ( "prefix" ) ; inPrefix . seek ( fr . refPrefix ) ; for ( int i = 0 ; i < fr . numberOfPrefixes ; i ++ ) { Long ref = inPrefix . getFilePointer ( ) ; String prefix = inPrefix . readString ( ) ; refs . put ( prefix , ref ) ; } } catch ( Exception e ) { log . error ( e ) ; refs . clear ( ) ; } prefixReferences . put ( field , refs ) ; return refs ; } else { return prefixReferences . get ( field ) ; } } else { return null ; } }
Gets the prefixes .
3,113
public IndexDoc getDoc ( String field , int docId ) { if ( fieldReferences . containsKey ( field ) ) { FieldReferences fr = fieldReferences . get ( field ) ; try { IndexInput inIndexDocId = indexInputList . get ( "indexDocId" ) ; ArrayList < MtasTreeHit < ? > > list = CodecSearchTree . searchMtasTree ( docId , inIndexDocId , fr . refIndexDocId , fr . refIndexDoc ) ; if ( list . size ( ) == 1 ) { return new IndexDoc ( list . get ( 0 ) . ref ) ; } } catch ( IOException e ) { log . debug ( e ) ; return null ; } } return null ; }
Gets the doc .
3,114
public IndexDoc getNextDoc ( String field , int previousDocId ) { if ( fieldReferences . containsKey ( field ) ) { FieldReferences fr = fieldReferences . get ( field ) ; try { if ( previousDocId < 0 ) { return new IndexDoc ( fr . refIndexDoc ) ; } else { int nextDocId = previousDocId + 1 ; IndexInput inIndexDocId = indexInputList . get ( "indexDocId" ) ; ArrayList < MtasTreeHit < ? > > list = CodecSearchTree . advanceMtasTree ( nextDocId , inIndexDocId , fr . refIndexDocId , fr . refIndexDoc ) ; if ( list . size ( ) == 1 ) { IndexInput inDoc = indexInputList . get ( "doc" ) ; inDoc . seek ( list . get ( 0 ) . ref ) ; return new IndexDoc ( inDoc . getFilePointer ( ) ) ; } } } catch ( IOException e ) { log . debug ( e ) ; return null ; } } return null ; }
Gets the next doc .
3,115
public int getNumberOfDocs ( String field ) { if ( fieldReferences . containsKey ( field ) ) { FieldReferences fr = fieldReferences . get ( field ) ; return fr . numberOfDocs ; } else { return 0 ; } }
Gets the number of docs .
3,116
public Integer getNumberOfPositions ( String field , int docId ) { if ( fieldReferences . containsKey ( field ) ) { IndexDoc doc = getDoc ( field , docId ) ; if ( doc != null ) { return 1 + doc . maxPosition - doc . minPosition ; } } return null ; }
Gets the number of positions .
3,117
public HashMap < Integer , Integer > getAllNumberOfPositions ( String field , int docBase ) throws IOException { HashMap < Integer , Integer > numbers = new HashMap < Integer , Integer > ( ) ; if ( fieldReferences . containsKey ( field ) ) { FieldReferences fr = fieldReferences . get ( field ) ; IndexInput inIndexDoc = indexInputList . get ( "doc" ) ; inIndexDoc . seek ( fr . refIndexDoc ) ; IndexDoc doc ; for ( int i = 0 ; i < fr . numberOfDocs ; i ++ ) { doc = new IndexDoc ( null ) ; numbers . put ( ( doc . docId + docBase ) , ( 1 + doc . maxPosition - doc . minPosition ) ) ; } } return numbers ; }
Gets the all number of positions .
3,118
public Integer getNumberOfTokens ( String field , int docId ) { if ( fieldReferences . containsKey ( field ) ) { IndexDoc doc = getDoc ( field , docId ) ; if ( doc != null ) { return doc . size ; } } return null ; }
Gets the number of tokens .
3,119
@ SuppressWarnings ( { "MethodMayBeStatic" } ) protected void addAllInterningAndSuffixing ( Collection < String > accumulator , Collection < String > addend , String suffix ) { boolean nonNullSuffix = suffix != null && ! "" . equals ( suffix ) ; if ( nonNullSuffix ) { suffix = '|' + suffix ; } for ( String feat : addend ) { if ( nonNullSuffix ) { feat = feat . concat ( suffix ) ; } accumulator . add ( feat ) ; } }
Makes more complete feature names out of partial feature names by adding a suffix to the String feature name adding results to an accumulator
3,120
protected String getWord ( CoreLabel label ) { String word = label . getString ( TextAnnotation . class ) ; if ( flags . wordFunction != null ) { word = flags . wordFunction . apply ( word ) ; } return word ; }
Convenience methods for subclasses which use CoreLabel . Gets the word after applying any wordFunction present in the SeqClassifierFlags .
3,121
private MutableDouble mutableRemove ( E key ) { MutableDouble md = map . remove ( key ) ; if ( md != null ) { totalCount -= md . doubleValue ( ) ; } return md ; }
This is used internally to the class for getting back a MutableDouble in a remove operation . Not for public use .
3,122
public static base_response renumber ( nitro_service client ) throws Exception { nsacls renumberresource = new nsacls ( ) ; return renumberresource . perform_operation ( client , "renumber" ) ; }
Use this API to renumber nsacls .
3,123
public static base_response clear ( nitro_service client ) throws Exception { nsacls clearresource = new nsacls ( ) ; return clearresource . perform_operation ( client , "clear" ) ; }
Use this API to clear nsacls .
3,124
public static base_response apply ( nitro_service client ) throws Exception { nsacls applyresource = new nsacls ( ) ; return applyresource . perform_operation ( client , "apply" ) ; }
Use this API to apply nsacls .
3,125
public static vlan_linkset_binding [ ] get ( nitro_service service , Long id ) throws Exception { vlan_linkset_binding obj = new vlan_linkset_binding ( ) ; obj . set_id ( id ) ; vlan_linkset_binding response [ ] = ( vlan_linkset_binding [ ] ) obj . get_resources ( service ) ; return response ; }
Use this API to fetch vlan_linkset_binding resources of given name .
3,126
public static base_response update ( nitro_service client , nsencryptionparams resource ) throws Exception { nsencryptionparams updateresource = new nsencryptionparams ( ) ; updateresource . method = resource . method ; updateresource . keyvalue = resource . keyvalue ; return updateresource . update_resource ( client ) ; }
Use this API to update nsencryptionparams .
3,127
public static nsencryptionparams get ( nitro_service service ) throws Exception { nsencryptionparams obj = new nsencryptionparams ( ) ; nsencryptionparams [ ] response = ( nsencryptionparams [ ] ) obj . get_resources ( service ) ; return response [ 0 ] ; }
Use this API to fetch all the nsencryptionparams resources that are configured on netscaler .
3,128
public static vpnvserver_auditsyslogpolicy_binding [ ] get ( nitro_service service , String name ) throws Exception { vpnvserver_auditsyslogpolicy_binding obj = new vpnvserver_auditsyslogpolicy_binding ( ) ; obj . set_name ( name ) ; vpnvserver_auditsyslogpolicy_binding response [ ] = ( vpnvserver_auditsyslogpolicy_binding [ ] ) obj . get_resources ( service ) ; return response ; }
Use this API to fetch vpnvserver_auditsyslogpolicy_binding resources of given name .
3,129
public static appfwprofile_xmldosurl_binding [ ] get ( nitro_service service , String name ) throws Exception { appfwprofile_xmldosurl_binding obj = new appfwprofile_xmldosurl_binding ( ) ; obj . set_name ( name ) ; appfwprofile_xmldosurl_binding response [ ] = ( appfwprofile_xmldosurl_binding [ ] ) obj . get_resources ( service ) ; return response ; }
Use this API to fetch appfwprofile_xmldosurl_binding resources of given name .
3,130
public TregexPattern compile ( String tregex ) { for ( Pair < String , String > macro : macros ) { tregex = tregex . replaceAll ( macro . first ( ) , macro . second ( ) ) ; } TregexPattern pattern ; try { TregexParser parser = new TregexParser ( new StringReader ( tregex + '\n' ) , basicCatFunction , headFinder ) ; pattern = parser . Root ( ) ; } catch ( TokenMgrError tme ) { throw new TregexParseException ( "Could not parse " + tregex , tme ) ; } catch ( ParseException e ) { throw new TregexParseException ( "Could not parse " + tregex , e ) ; } pattern . setPatternString ( tregex ) ; return pattern ; }
Create a TregexPattern from this tregex string using the headFinder and basicCat function this TregexPatternCompiler was created with .
3,131
public static responderpolicy_csvserver_binding [ ] get ( nitro_service service , String name ) throws Exception { responderpolicy_csvserver_binding obj = new responderpolicy_csvserver_binding ( ) ; obj . set_name ( name ) ; responderpolicy_csvserver_binding response [ ] = ( responderpolicy_csvserver_binding [ ] ) obj . get_resources ( service ) ; return response ; }
Use this API to fetch responderpolicy_csvserver_binding resources of given name .
3,132
public static sslcrl_serialnumber_binding [ ] get ( nitro_service service , String crlname ) throws Exception { sslcrl_serialnumber_binding obj = new sslcrl_serialnumber_binding ( ) ; obj . set_crlname ( crlname ) ; sslcrl_serialnumber_binding response [ ] = ( sslcrl_serialnumber_binding [ ] ) obj . get_resources ( service ) ; return response ; }
Use this API to fetch sslcrl_serialnumber_binding resources of given name .
3,133
public static long count ( nitro_service service , String crlname ) throws Exception { sslcrl_serialnumber_binding obj = new sslcrl_serialnumber_binding ( ) ; obj . set_crlname ( crlname ) ; options option = new options ( ) ; option . set_count ( true ) ; sslcrl_serialnumber_binding response [ ] = ( sslcrl_serialnumber_binding [ ] ) obj . get_resources ( service , option ) ; if ( response != null ) { return response [ 0 ] . __count ; } return 0 ; }
Use this API to count sslcrl_serialnumber_binding resources configued on NetScaler .
3,134
public static base_response add ( nitro_service client , aaauser resource ) throws Exception { aaauser addresource = new aaauser ( ) ; addresource . username = resource . username ; addresource . password = resource . password ; return addresource . add_resource ( client ) ; }
Use this API to add aaauser .
3,135
public static base_responses add ( nitro_service client , aaauser resources [ ] ) throws Exception { base_responses result = null ; if ( resources != null && resources . length > 0 ) { aaauser addresources [ ] = new aaauser [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { addresources [ i ] = new aaauser ( ) ; addresources [ i ] . username = resources [ i ] . username ; addresources [ i ] . password = resources [ i ] . password ; } result = add_bulk_request ( client , addresources ) ; } return result ; }
Use this API to add aaauser resources .
3,136
public static base_response update ( nitro_service client , aaauser resource ) throws Exception { aaauser updateresource = new aaauser ( ) ; updateresource . username = resource . username ; updateresource . password = resource . password ; return updateresource . update_resource ( client ) ; }
Use this API to update aaauser .
3,137
public static aaauser [ ] get ( nitro_service service ) throws Exception { aaauser obj = new aaauser ( ) ; aaauser [ ] response = ( aaauser [ ] ) obj . get_resources ( service ) ; return response ; }
Use this API to fetch all the aaauser resources that are configured on netscaler .
3,138
public static aaauser [ ] get ( nitro_service service , aaauser_args args ) throws Exception { aaauser obj = new aaauser ( ) ; options option = new options ( ) ; option . set_args ( nitro_util . object_to_string_withoutquotes ( args ) ) ; aaauser [ ] response = ( aaauser [ ] ) obj . get_resources ( service , option ) ; return response ; }
Use this API to fetch all the aaauser resources that are configured on netscaler . This uses aaauser_args which is a way to provide additional arguments while fetching the resources .
3,139
public static aaauser get ( nitro_service service , String username ) throws Exception { aaauser obj = new aaauser ( ) ; obj . set_username ( username ) ; aaauser response = ( aaauser ) obj . get_resource ( service ) ; return response ; }
Use this API to fetch aaauser resource of given name .
3,140
public static aaauser [ ] get ( nitro_service service , String username [ ] ) throws Exception { if ( username != null && username . length > 0 ) { aaauser response [ ] = new aaauser [ username . length ] ; aaauser obj [ ] = new aaauser [ username . length ] ; for ( int i = 0 ; i < username . length ; i ++ ) { obj [ i ] = new aaauser ( ) ; obj [ i ] . set_username ( username [ i ] ) ; response [ i ] = ( aaauser ) obj [ i ] . get_resource ( service ) ; } return response ; } return null ; }
Use this API to fetch aaauser resources of given names .
3,141
public static authenticationcertpolicy_authenticationvserver_binding [ ] get ( nitro_service service , String name ) throws Exception { authenticationcertpolicy_authenticationvserver_binding obj = new authenticationcertpolicy_authenticationvserver_binding ( ) ; obj . set_name ( name ) ; authenticationcertpolicy_authenticationvserver_binding response [ ] = ( authenticationcertpolicy_authenticationvserver_binding [ ] ) obj . get_resources ( service ) ; return response ; }
Use this API to fetch authenticationcertpolicy_authenticationvserver_binding resources of given name .
3,142
public void addRule ( IntDependency dependency , double count ) { if ( ! directional ) { dependency = new IntDependency ( dependency . head , dependency . arg , false , dependency . distance ) ; } if ( verbose ) System . err . println ( "Adding dep " + dependency ) ; expandDependency ( dependency , count ) ; }
Add this dependency with the given count to the grammar . This is the main entry point of MLEDependencyGrammarExtractor . This is a dependency represented in the full tag space .
3,143
private IntTaggedWord getCachedITW ( short tag ) { if ( tagITWList == null ) { tagITWList = new ArrayList < IntTaggedWord > ( numTagBins + 2 ) ; for ( int i = 0 ; i < numTagBins + 2 ; i ++ ) { tagITWList . add ( i , null ) ; } } IntTaggedWord headT = tagITWList . get ( tagBin ( tag ) + 2 ) ; if ( headT == null ) { headT = new IntTaggedWord ( ANY_WORD_INT , tagBin ( tag ) ) ; tagITWList . set ( tagBin ( tag ) + 2 , headT ) ; } return headT ; }
This maps from a tag to a cached IntTagWord that represents the tag by having the wildcard word ANY_WORD_INT and the tag in the reduced tag space . The argument is in terms of the full tag space ; internally this function maps to the reduced space .
3,144
protected void expandDependency ( IntDependency dependency , double count ) { if ( dependency . head == null || dependency . arg == null ) { return ; } if ( dependency . arg . word != STOP_WORD_INT ) { expandArg ( dependency , valenceBin ( dependency . distance ) , count ) ; } expandStop ( dependency , distanceBin ( dependency . distance ) , count , true ) ; }
The dependency arg is still in the full tag space .
3,145
public double scoreTB ( IntDependency dependency ) { return op . testOptions . depWeight * Math . log ( probTB ( dependency ) ) ; }
Score a tag binned dependency .
3,146
public void readData ( BufferedReader in ) throws IOException { final String LEFT = "left" ; int lineNum = 1 ; boolean doingStop = false ; for ( String line = in . readLine ( ) ; line != null && line . length ( ) > 0 ; line = in . readLine ( ) ) { try { if ( line . equals ( "BEGIN_STOP" ) ) { doingStop = true ; continue ; } String [ ] fields = StringUtils . splitOnCharWithQuoting ( line , ' ' , '\"' , '\\' ) ; short distance = ( short ) Integer . parseInt ( fields [ 4 ] ) ; IntTaggedWord tempHead = new IntTaggedWord ( fields [ 0 ] , '/' , wordIndex , tagIndex ) ; IntTaggedWord tempArg = new IntTaggedWord ( fields [ 2 ] , '/' , wordIndex , tagIndex ) ; IntDependency tempDependency = new IntDependency ( tempHead , tempArg , fields [ 3 ] . equals ( LEFT ) , distance ) ; double count = Double . parseDouble ( fields [ 5 ] ) ; if ( doingStop ) { expandStop ( tempDependency , distance , count , false ) ; } else { expandArg ( tempDependency , distance , count ) ; } } catch ( Exception e ) { IOException ioe = new IOException ( "Error on line " + lineNum + ": " + line ) ; ioe . initCause ( e ) ; throw ioe ; } lineNum ++ ; } }
Populates data in this DependencyGrammar from the character stream given by the Reader r .
3,147
public void writeData ( PrintWriter out ) throws IOException { for ( IntDependency dependency : argCounter . keySet ( ) ) { if ( dependency . head != wildTW && dependency . arg != wildTW && dependency . head . word != - 1 && dependency . arg . word != - 1 ) { double count = argCounter . getCount ( dependency ) ; out . println ( dependency . toString ( wordIndex , tagIndex ) + " " + count ) ; } } out . println ( "BEGIN_STOP" ) ; for ( IntDependency dependency : stopCounter . keySet ( ) ) { if ( dependency . head . word != - 1 ) { double count = stopCounter . getCount ( dependency ) ; out . println ( dependency . toString ( wordIndex , tagIndex ) + " " + count ) ; } } out . flush ( ) ; }
Writes out data from this Object to the Writer w .
3,148
public static base_response add ( nitro_service client , vpnintranetapplication resource ) throws Exception { vpnintranetapplication addresource = new vpnintranetapplication ( ) ; addresource . intranetapplication = resource . intranetapplication ; addresource . protocol = resource . protocol ; addresource . destip = resource . destip ; addresource . netmask = resource . netmask ; addresource . iprange = resource . iprange ; addresource . hostname = resource . hostname ; addresource . clientapplication = resource . clientapplication ; addresource . spoofiip = resource . spoofiip ; addresource . destport = resource . destport ; addresource . interception = resource . interception ; addresource . srcip = resource . srcip ; addresource . srcport = resource . srcport ; return addresource . add_resource ( client ) ; }
Use this API to add vpnintranetapplication .
3,149
public static base_responses add ( nitro_service client , vpnintranetapplication resources [ ] ) throws Exception { base_responses result = null ; if ( resources != null && resources . length > 0 ) { vpnintranetapplication addresources [ ] = new vpnintranetapplication [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { addresources [ i ] = new vpnintranetapplication ( ) ; addresources [ i ] . intranetapplication = resources [ i ] . intranetapplication ; addresources [ i ] . protocol = resources [ i ] . protocol ; addresources [ i ] . destip = resources [ i ] . destip ; addresources [ i ] . netmask = resources [ i ] . netmask ; addresources [ i ] . iprange = resources [ i ] . iprange ; addresources [ i ] . hostname = resources [ i ] . hostname ; addresources [ i ] . clientapplication = resources [ i ] . clientapplication ; addresources [ i ] . spoofiip = resources [ i ] . spoofiip ; addresources [ i ] . destport = resources [ i ] . destport ; addresources [ i ] . interception = resources [ i ] . interception ; addresources [ i ] . srcip = resources [ i ] . srcip ; addresources [ i ] . srcport = resources [ i ] . srcport ; } result = add_bulk_request ( client , addresources ) ; } return result ; }
Use this API to add vpnintranetapplication resources .
3,150
public static base_response delete ( nitro_service client , String intranetapplication ) throws Exception { vpnintranetapplication deleteresource = new vpnintranetapplication ( ) ; deleteresource . intranetapplication = intranetapplication ; return deleteresource . delete_resource ( client ) ; }
Use this API to delete vpnintranetapplication of given name .
3,151
public static vpnintranetapplication [ ] get ( nitro_service service ) throws Exception { vpnintranetapplication obj = new vpnintranetapplication ( ) ; vpnintranetapplication [ ] response = ( vpnintranetapplication [ ] ) obj . get_resources ( service ) ; return response ; }
Use this API to fetch all the vpnintranetapplication resources that are configured on netscaler .
3,152
public static vpnintranetapplication get ( nitro_service service , String intranetapplication ) throws Exception { vpnintranetapplication obj = new vpnintranetapplication ( ) ; obj . set_intranetapplication ( intranetapplication ) ; vpnintranetapplication response = ( vpnintranetapplication ) obj . get_resource ( service ) ; return response ; }
Use this API to fetch vpnintranetapplication resource of given name .
3,153
public static vpnintranetapplication [ ] get ( nitro_service service , String intranetapplication [ ] ) throws Exception { if ( intranetapplication != null && intranetapplication . length > 0 ) { vpnintranetapplication response [ ] = new vpnintranetapplication [ intranetapplication . length ] ; vpnintranetapplication obj [ ] = new vpnintranetapplication [ intranetapplication . length ] ; for ( int i = 0 ; i < intranetapplication . length ; i ++ ) { obj [ i ] = new vpnintranetapplication ( ) ; obj [ i ] . set_intranetapplication ( intranetapplication [ i ] ) ; response [ i ] = ( vpnintranetapplication ) obj [ i ] . get_resource ( service ) ; } return response ; } return null ; }
Use this API to fetch vpnintranetapplication resources of given names .
3,154
public static sslpolicy_sslvserver_binding [ ] get ( nitro_service service , String name ) throws Exception { sslpolicy_sslvserver_binding obj = new sslpolicy_sslvserver_binding ( ) ; obj . set_name ( name ) ; sslpolicy_sslvserver_binding response [ ] = ( sslpolicy_sslvserver_binding [ ] ) obj . get_resources ( service ) ; return response ; }
Use this API to fetch sslpolicy_sslvserver_binding resources of given name .
3,155
public static tmsessionpolicy_tmglobal_binding [ ] get ( nitro_service service , String name ) throws Exception { tmsessionpolicy_tmglobal_binding obj = new tmsessionpolicy_tmglobal_binding ( ) ; obj . set_name ( name ) ; tmsessionpolicy_tmglobal_binding response [ ] = ( tmsessionpolicy_tmglobal_binding [ ] ) obj . get_resources ( service ) ; return response ; }
Use this API to fetch tmsessionpolicy_tmglobal_binding resources of given name .
3,156
public static base_response update ( nitro_service client , nsweblogparam resource ) throws Exception { nsweblogparam updateresource = new nsweblogparam ( ) ; updateresource . buffersizemb = resource . buffersizemb ; updateresource . customreqhdrs = resource . customreqhdrs ; updateresource . customrsphdrs = resource . customrsphdrs ; return updateresource . update_resource ( client ) ; }
Use this API to update nsweblogparam .
3,157
public static base_response unset ( nitro_service client , nsweblogparam resource , String [ ] args ) throws Exception { nsweblogparam unsetresource = new nsweblogparam ( ) ; return unsetresource . unset_resource ( client , args ) ; }
Use this API to unset the properties of nsweblogparam resource . Properties that need to be unset are specified in args array .
3,158
public static nsweblogparam get ( nitro_service service , options option ) throws Exception { nsweblogparam obj = new nsweblogparam ( ) ; nsweblogparam [ ] response = ( nsweblogparam [ ] ) obj . get_resources ( service , option ) ; return response [ 0 ] ; }
Use this API to fetch all the nsweblogparam resources that are configured on netscaler .
3,159
public static nslicense get ( nitro_service service ) throws Exception { nslicense obj = new nslicense ( ) ; nslicense [ ] response = ( nslicense [ ] ) obj . get_resources ( service ) ; return response [ 0 ] ; }
Use this API to fetch all the nslicense resources that are configured on netscaler .
3,160
public static ipset_binding get ( nitro_service service , String name ) throws Exception { ipset_binding obj = new ipset_binding ( ) ; obj . set_name ( name ) ; ipset_binding response = ( ipset_binding ) obj . get_resource ( service ) ; return response ; }
Use this API to fetch ipset_binding resource of given name .
3,161
public long [ ] elements ( ) { long [ ] myElements = new long [ size ] ; for ( int i = size ; -- i >= 0 ; ) myElements [ i ] = getQuick ( i ) ; return myElements ; }
Returns the elements currently stored possibly including invalid elements between size and capacity .
3,162
public static auditsyslogpolicy_binding get ( nitro_service service , String name ) throws Exception { auditsyslogpolicy_binding obj = new auditsyslogpolicy_binding ( ) ; obj . set_name ( name ) ; auditsyslogpolicy_binding response = ( auditsyslogpolicy_binding ) obj . get_resource ( service ) ; return response ; }
Use this API to fetch auditsyslogpolicy_binding resource of given name .
3,163
public static sslcipher_sslciphersuite_binding [ ] get ( nitro_service service , String ciphergroupname ) throws Exception { sslcipher_sslciphersuite_binding obj = new sslcipher_sslciphersuite_binding ( ) ; obj . set_ciphergroupname ( ciphergroupname ) ; sslcipher_sslciphersuite_binding response [ ] = ( sslcipher_sslciphersuite_binding [ ] ) obj . get_resources ( service ) ; return response ; }
Use this API to fetch sslcipher_sslciphersuite_binding resources of given name .
3,164
public static sslcipher_binding get ( nitro_service service , String ciphergroupname ) throws Exception { sslcipher_binding obj = new sslcipher_binding ( ) ; obj . set_ciphergroupname ( ciphergroupname ) ; sslcipher_binding response = ( sslcipher_binding ) obj . get_resource ( service ) ; return response ; }
Use this API to fetch sslcipher_binding resource of given name .
3,165
public static auditnslogpolicy_tmglobal_binding [ ] get ( nitro_service service , String name ) throws Exception { auditnslogpolicy_tmglobal_binding obj = new auditnslogpolicy_tmglobal_binding ( ) ; obj . set_name ( name ) ; auditnslogpolicy_tmglobal_binding response [ ] = ( auditnslogpolicy_tmglobal_binding [ ] ) obj . get_resources ( service ) ; return response ; }
Use this API to fetch auditnslogpolicy_tmglobal_binding resources of given name .
3,166
public static base_response update ( nitro_service client , nsdhcpparams resource ) throws Exception { nsdhcpparams updateresource = new nsdhcpparams ( ) ; updateresource . dhcpclient = resource . dhcpclient ; updateresource . saveroute = resource . saveroute ; return updateresource . update_resource ( client ) ; }
Use this API to update nsdhcpparams .
3,167
public static base_response unset ( nitro_service client , nsdhcpparams resource , String [ ] args ) throws Exception { nsdhcpparams unsetresource = new nsdhcpparams ( ) ; return unsetresource . unset_resource ( client , args ) ; }
Use this API to unset the properties of nsdhcpparams resource . Properties that need to be unset are specified in args array .
3,168
public static nsdhcpparams get ( nitro_service service ) throws Exception { nsdhcpparams obj = new nsdhcpparams ( ) ; nsdhcpparams [ ] response = ( nsdhcpparams [ ] ) obj . get_resources ( service ) ; return response [ 0 ] ; }
Use this API to fetch all the nsdhcpparams resources that are configured on netscaler .
3,169
public static base_response update ( nitro_service client , filterprebodyinjection resource ) throws Exception { filterprebodyinjection updateresource = new filterprebodyinjection ( ) ; updateresource . prebody = resource . prebody ; return updateresource . update_resource ( client ) ; }
Use this API to update filterprebodyinjection .
3,170
public static base_response unset ( nitro_service client , filterprebodyinjection resource , String [ ] args ) throws Exception { filterprebodyinjection unsetresource = new filterprebodyinjection ( ) ; return unsetresource . unset_resource ( client , args ) ; }
Use this API to unset the properties of filterprebodyinjection resource . Properties that need to be unset are specified in args array .
3,171
public static filterprebodyinjection get ( nitro_service service ) throws Exception { filterprebodyinjection obj = new filterprebodyinjection ( ) ; filterprebodyinjection [ ] response = ( filterprebodyinjection [ ] ) obj . get_resources ( service ) ; return response [ 0 ] ; }
Use this API to fetch all the filterprebodyinjection resources that are configured on netscaler .
3,172
public static vpntrafficpolicy_aaauser_binding [ ] get ( nitro_service service , String name ) throws Exception { vpntrafficpolicy_aaauser_binding obj = new vpntrafficpolicy_aaauser_binding ( ) ; obj . set_name ( name ) ; vpntrafficpolicy_aaauser_binding response [ ] = ( vpntrafficpolicy_aaauser_binding [ ] ) obj . get_resources ( service ) ; return response ; }
Use this API to fetch vpntrafficpolicy_aaauser_binding resources of given name .
3,173
public static sslpolicylabel_sslpolicy_binding [ ] get ( nitro_service service , String labelname ) throws Exception { sslpolicylabel_sslpolicy_binding obj = new sslpolicylabel_sslpolicy_binding ( ) ; obj . set_labelname ( labelname ) ; sslpolicylabel_sslpolicy_binding response [ ] = ( sslpolicylabel_sslpolicy_binding [ ] ) obj . get_resources ( service ) ; return response ; }
Use this API to fetch sslpolicylabel_sslpolicy_binding resources of given name .
3,174
void init ( ) { numnegative = new int [ numSamples ( ) + 1 ] ; numpositive = new int [ numSamples ( ) + 1 ] ; numnegative [ 0 ] = 0 ; numpositive [ 0 ] = 0 ; int num = numSamples ( ) ; for ( int i = 1 ; i <= num ; i ++ ) { numnegative [ i ] = numnegative [ i - 1 ] + ( classes [ i - 1 ] == 0 ? 1 : 0 ) ; } for ( int i = 1 ; i <= num ; i ++ ) { numpositive [ i ] = numpositive [ i - 1 ] + ( classes [ num - i ] == 0 ? 0 : 1 ) ; } System . err . println ( "total positive " + numpositive [ num ] + " total negative " + numnegative [ num ] + " total " + num ) ; for ( int i = 1 ; i < numpositive . length ; i ++ ) { } }
initialize the numpositive and the numnegative arrays
3,175
public int precision ( int recall ) { int optimum = 0 ; for ( int right = 0 ; right <= recall ; right ++ ) { int candidate = numpositive [ right ] + numnegative [ recall - right ] ; if ( candidate > optimum ) { optimum = candidate ; } } return optimum ; }
what is the best precision at the given recall
3,176
public double fmeasure ( int numleft , int numright ) { int tp = 0 , fp = 0 , fn = 0 ; tp = numpositive [ numright ] ; fp = numright - tp ; fn = numleft - numnegative [ numleft ] ; return f1 ( tp , fp , fn ) ; }
the f - measure if we just guess as negativ the first numleft and guess as poitive the last numright
3,177
public int logPrecision ( int recall ) { int totaltaken = 0 ; int rightIndex = numSamples ( ) - 1 ; int leftIndex = 0 ; int totalcorrect = 0 ; while ( totaltaken < recall ) { double confr = Math . abs ( scores [ rightIndex ] - .5 ) ; double confl = Math . abs ( scores [ leftIndex ] - .5 ) ; int chosen = leftIndex ; if ( confr > confl ) { chosen = rightIndex ; rightIndex -- ; } else { leftIndex ++ ; } if ( ( scores [ chosen ] >= .5 ) && ( classes [ chosen ] == 1 ) ) { totalcorrect ++ ; } if ( ( scores [ chosen ] < .5 ) && ( classes [ chosen ] == 0 ) ) { totalcorrect ++ ; } totaltaken ++ ; } return totalcorrect ; }
what is the precision at this recall if we look at the score as the probability of class 1 given x as if coming from logistic regression
3,178
public double optFmeasure ( int recall ) { double max = 0 ; for ( int i = 0 ; i < ( recall + 1 ) ; i ++ ) { double f = fmeasure ( i , recall - i ) ; if ( f > max ) { max = f ; } } return max ; }
what is the optimal f - measure we can achieve given recall guesses using the optimal monotonic function
3,179
public double fmeasure ( int recall ) { int totaltaken = 0 ; int rightIndex = numSamples ( ) - 1 ; int leftIndex = 0 ; int tp = 0 , fp = 0 , fn = 0 ; while ( totaltaken < recall ) { double confr = Math . abs ( scores [ rightIndex ] - .5 ) ; double confl = Math . abs ( scores [ leftIndex ] - .5 ) ; int chosen = leftIndex ; if ( confr > confl ) { chosen = rightIndex ; rightIndex -- ; } else { leftIndex ++ ; } if ( ( scores [ chosen ] >= .5 ) ) { if ( classes [ chosen ] == 1 ) { tp ++ ; } else { fp ++ ; } } if ( ( scores [ chosen ] < .5 ) ) { if ( classes [ chosen ] == 1 ) { fn ++ ; } } totaltaken ++ ; } return f1 ( tp , fp , fn ) ; }
what is the f - measure at this recall if we look at the score as the probability of class 1 given x as if coming from logistic regression same as logPrecision but calculating f - measure
3,180
public double logLikelihood ( ) { double loglik = 0 ; for ( int i = 0 ; i < scores . length ; i ++ ) { loglik += Math . log ( classes [ i ] == 0 ? 1 - scores [ i ] : scores [ i ] ) ; } return loglik ; }
assuming the scores are probability of 1 given x
3,181
public double optimalCwa ( ) { double acc = 0 ; for ( int recall = 1 ; recall <= numSamples ( ) ; recall ++ ) { acc += precision ( recall ) / ( double ) recall ; } return acc / numSamples ( ) ; }
optimal confidence weighted accuracy assuming for each recall we can fit an optimal monotonic function
3,182
public static nssimpleacl6_stats get ( nitro_service service ) throws Exception { nssimpleacl6_stats obj = new nssimpleacl6_stats ( ) ; nssimpleacl6_stats [ ] response = ( nssimpleacl6_stats [ ] ) obj . stat_resources ( service ) ; return response [ 0 ] ; }
Use this API to fetch the statistics of all nssimpleacl6_stats resources that are configured on netscaler .
3,183
public static Pair < TregexPattern , TsurgeonPattern > getOperationFromReader ( BufferedReader reader , TregexPatternCompiler compiler ) throws IOException { String patternString = getPatternFromFile ( reader ) ; if ( "" . equals ( patternString ) ) { return null ; } TregexPattern matchPattern = compiler . compile ( patternString ) ; TsurgeonPattern collectedPattern = getTsurgeonOperationsFromReader ( reader ) ; return new Pair < TregexPattern , TsurgeonPattern > ( matchPattern , collectedPattern ) ; }
Parses a tsurgeon script text input and compiles a tregex pattern and a list of tsurgeon operations into a pair .
3,184
public static String getPatternFromFile ( BufferedReader reader ) throws IOException { StringBuilder matchString = new StringBuilder ( ) ; for ( String thisLine ; ( thisLine = reader . readLine ( ) ) != null ; ) { if ( matchString . length ( ) > 0 && emptyLinePattern . matcher ( thisLine ) . matches ( ) ) { break ; } Matcher m = commentPattern . matcher ( thisLine ) ; if ( m . matches ( ) ) { thisLine = m . replaceFirst ( "" ) ; } if ( ! emptyLinePattern . matcher ( thisLine ) . matches ( ) ) { matchString . append ( thisLine ) ; } } return matchString . toString ( ) ; }
Assumes that we are at the beginning of a tsurgeon script file and gets the string for the tregex pattern leading the file
3,185
public static List < Pair < TregexPattern , TsurgeonPattern > > getOperationsFromFile ( String filename , String encoding , TregexPatternCompiler compiler ) throws IOException { List < Pair < TregexPattern , TsurgeonPattern > > operations = new ArrayList < Pair < TregexPattern , TsurgeonPattern > > ( ) ; BufferedReader reader = new BufferedReader ( new InputStreamReader ( new FileInputStream ( filename ) , encoding ) ) ; for ( ; ; ) { Pair < TregexPattern , TsurgeonPattern > operation = getOperationFromReader ( reader , compiler ) ; if ( operation == null ) { break ; } operations . add ( operation ) ; } reader . close ( ) ; return operations ; }
Parses a tsurgeon script file and compiles all operations in the file into a list of pairs of tregex and tsurgeon patterns .
3,186
public static Tree processPatternsOnTree ( List < Pair < TregexPattern , TsurgeonPattern > > ops , Tree t ) { matchedOnTree = false ; for ( Pair < TregexPattern , TsurgeonPattern > op : ops ) { try { if ( DEBUG ) { System . err . println ( "Running pattern " + op . first ( ) ) ; } TregexMatcher m = op . first ( ) . matcher ( t ) ; while ( m . find ( ) ) { matchedOnTree = true ; t = op . second ( ) . evaluate ( t , m ) ; if ( t == null ) { return null ; } m = op . first ( ) . matcher ( t ) ; } } catch ( NullPointerException npe ) { throw new RuntimeException ( "Tsurgeon.processPatternsOnTree failed to match label for pattern: " + op . first ( ) + ", " + op . second ( ) , npe ) ; } } return t ; }
hack - in field for seeing whether there was a match .
3,187
public static TsurgeonPattern collectOperations ( List < TsurgeonPattern > patterns ) { return new TsurgeonPatternRoot ( patterns . toArray ( new TsurgeonPattern [ patterns . size ( ) ] ) ) ; }
Collects a list of operation patterns into a sequence of operations to be applied . Required to keep track of global properties across a sequence of operations . For example if you want to insert a named node and then coindex it with another node you will need to collect the insertion and coindexation operations into a single TsurgeonPattern so that tsurgeon is aware of the name of the new node and coindexation becomes possible .
3,188
public static dnspolicylabel_stats [ ] get ( nitro_service service , options option ) throws Exception { dnspolicylabel_stats obj = new dnspolicylabel_stats ( ) ; dnspolicylabel_stats [ ] response = ( dnspolicylabel_stats [ ] ) obj . stat_resources ( service , option ) ; return response ; }
Use this API to fetch the statistics of all dnspolicylabel_stats resources that are configured on netscaler .
3,189
public static dnspolicylabel_stats get ( nitro_service service , String labelname ) throws Exception { dnspolicylabel_stats obj = new dnspolicylabel_stats ( ) ; obj . set_labelname ( labelname ) ; dnspolicylabel_stats response = ( dnspolicylabel_stats ) obj . stat_resource ( service ) ; return response ; }
Use this API to fetch statistics of dnspolicylabel_stats resource of given name .
3,190
public static gslbvserver_domain_binding [ ] get ( nitro_service service , String name ) throws Exception { gslbvserver_domain_binding obj = new gslbvserver_domain_binding ( ) ; obj . set_name ( name ) ; gslbvserver_domain_binding response [ ] = ( gslbvserver_domain_binding [ ] ) obj . get_resources ( service ) ; return response ; }
Use this API to fetch gslbvserver_domain_binding resources of given name .
3,191
public static base_response add ( nitro_service client , nsip resource ) throws Exception { nsip addresource = new nsip ( ) ; addresource . ipaddress = resource . ipaddress ; addresource . netmask = resource . netmask ; addresource . type = resource . type ; addresource . arp = resource . arp ; addresource . icmp = resource . icmp ; addresource . vserver = resource . vserver ; addresource . telnet = resource . telnet ; addresource . ftp = resource . ftp ; addresource . gui = resource . gui ; addresource . ssh = resource . ssh ; addresource . snmp = resource . snmp ; addresource . mgmtaccess = resource . mgmtaccess ; addresource . restrictaccess = resource . restrictaccess ; addresource . dynamicrouting = resource . dynamicrouting ; addresource . ospf = resource . ospf ; addresource . bgp = resource . bgp ; addresource . rip = resource . rip ; addresource . hostroute = resource . hostroute ; addresource . hostrtgw = resource . hostrtgw ; addresource . metric = resource . metric ; addresource . vserverrhilevel = resource . vserverrhilevel ; addresource . ospflsatype = resource . ospflsatype ; addresource . ospfarea = resource . ospfarea ; addresource . state = resource . state ; addresource . vrid = resource . vrid ; addresource . icmpresponse = resource . icmpresponse ; addresource . ownernode = resource . ownernode ; addresource . arpresponse = resource . arpresponse ; addresource . td = resource . td ; return addresource . add_resource ( client ) ; }
Use this API to add nsip .
3,192
public static base_responses add ( nitro_service client , nsip resources [ ] ) throws Exception { base_responses result = null ; if ( resources != null && resources . length > 0 ) { nsip addresources [ ] = new nsip [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { addresources [ i ] = new nsip ( ) ; addresources [ i ] . ipaddress = resources [ i ] . ipaddress ; addresources [ i ] . netmask = resources [ i ] . netmask ; addresources [ i ] . type = resources [ i ] . type ; addresources [ i ] . arp = resources [ i ] . arp ; addresources [ i ] . icmp = resources [ i ] . icmp ; addresources [ i ] . vserver = resources [ i ] . vserver ; addresources [ i ] . telnet = resources [ i ] . telnet ; addresources [ i ] . ftp = resources [ i ] . ftp ; addresources [ i ] . gui = resources [ i ] . gui ; addresources [ i ] . ssh = resources [ i ] . ssh ; addresources [ i ] . snmp = resources [ i ] . snmp ; addresources [ i ] . mgmtaccess = resources [ i ] . mgmtaccess ; addresources [ i ] . restrictaccess = resources [ i ] . restrictaccess ; addresources [ i ] . dynamicrouting = resources [ i ] . dynamicrouting ; addresources [ i ] . ospf = resources [ i ] . ospf ; addresources [ i ] . bgp = resources [ i ] . bgp ; addresources [ i ] . rip = resources [ i ] . rip ; addresources [ i ] . hostroute = resources [ i ] . hostroute ; addresources [ i ] . hostrtgw = resources [ i ] . hostrtgw ; addresources [ i ] . metric = resources [ i ] . metric ; addresources [ i ] . vserverrhilevel = resources [ i ] . vserverrhilevel ; addresources [ i ] . ospflsatype = resources [ i ] . ospflsatype ; addresources [ i ] . ospfarea = resources [ i ] . ospfarea ; addresources [ i ] . state = resources [ i ] . state ; addresources [ i ] . vrid = resources [ i ] . vrid ; addresources [ i ] . icmpresponse = resources [ i ] . icmpresponse ; addresources [ i ] . ownernode = resources [ i ] . ownernode ; addresources [ i ] . arpresponse = resources [ i ] . arpresponse ; addresources [ i ] . td = resources [ i ] . td ; } result = add_bulk_request ( client , addresources ) ; } return result ; }
Use this API to add nsip resources .
3,193
public static base_response delete ( nitro_service client , nsip resource ) throws Exception { nsip deleteresource = new nsip ( ) ; deleteresource . ipaddress = resource . ipaddress ; deleteresource . td = resource . td ; return deleteresource . delete_resource ( client ) ; }
Use this API to delete nsip .
3,194
public static base_response update ( nitro_service client , nsip resource ) throws Exception { nsip updateresource = new nsip ( ) ; updateresource . ipaddress = resource . ipaddress ; updateresource . td = resource . td ; updateresource . netmask = resource . netmask ; updateresource . arp = resource . arp ; updateresource . icmp = resource . icmp ; updateresource . vserver = resource . vserver ; updateresource . telnet = resource . telnet ; updateresource . ftp = resource . ftp ; updateresource . gui = resource . gui ; updateresource . ssh = resource . ssh ; updateresource . snmp = resource . snmp ; updateresource . mgmtaccess = resource . mgmtaccess ; updateresource . restrictaccess = resource . restrictaccess ; updateresource . dynamicrouting = resource . dynamicrouting ; updateresource . ospf = resource . ospf ; updateresource . bgp = resource . bgp ; updateresource . rip = resource . rip ; updateresource . hostroute = resource . hostroute ; updateresource . hostrtgw = resource . hostrtgw ; updateresource . metric = resource . metric ; updateresource . vserverrhilevel = resource . vserverrhilevel ; updateresource . ospflsatype = resource . ospflsatype ; updateresource . ospfarea = resource . ospfarea ; updateresource . vrid = resource . vrid ; updateresource . icmpresponse = resource . icmpresponse ; updateresource . arpresponse = resource . arpresponse ; return updateresource . update_resource ( client ) ; }
Use this API to update nsip .
3,195
public static base_responses update ( nitro_service client , nsip resources [ ] ) throws Exception { base_responses result = null ; if ( resources != null && resources . length > 0 ) { nsip updateresources [ ] = new nsip [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { updateresources [ i ] = new nsip ( ) ; updateresources [ i ] . ipaddress = resources [ i ] . ipaddress ; updateresources [ i ] . td = resources [ i ] . td ; updateresources [ i ] . netmask = resources [ i ] . netmask ; updateresources [ i ] . arp = resources [ i ] . arp ; updateresources [ i ] . icmp = resources [ i ] . icmp ; updateresources [ i ] . vserver = resources [ i ] . vserver ; updateresources [ i ] . telnet = resources [ i ] . telnet ; updateresources [ i ] . ftp = resources [ i ] . ftp ; updateresources [ i ] . gui = resources [ i ] . gui ; updateresources [ i ] . ssh = resources [ i ] . ssh ; updateresources [ i ] . snmp = resources [ i ] . snmp ; updateresources [ i ] . mgmtaccess = resources [ i ] . mgmtaccess ; updateresources [ i ] . restrictaccess = resources [ i ] . restrictaccess ; updateresources [ i ] . dynamicrouting = resources [ i ] . dynamicrouting ; updateresources [ i ] . ospf = resources [ i ] . ospf ; updateresources [ i ] . bgp = resources [ i ] . bgp ; updateresources [ i ] . rip = resources [ i ] . rip ; updateresources [ i ] . hostroute = resources [ i ] . hostroute ; updateresources [ i ] . hostrtgw = resources [ i ] . hostrtgw ; updateresources [ i ] . metric = resources [ i ] . metric ; updateresources [ i ] . vserverrhilevel = resources [ i ] . vserverrhilevel ; updateresources [ i ] . ospflsatype = resources [ i ] . ospflsatype ; updateresources [ i ] . ospfarea = resources [ i ] . ospfarea ; updateresources [ i ] . vrid = resources [ i ] . vrid ; updateresources [ i ] . icmpresponse = resources [ i ] . icmpresponse ; updateresources [ i ] . arpresponse = resources [ i ] . arpresponse ; } result = update_bulk_request ( client , updateresources ) ; } return result ; }
Use this API to update nsip resources .
3,196
public static base_response unset ( nitro_service client , nsip resource , String [ ] args ) throws Exception { nsip unsetresource = new nsip ( ) ; unsetresource . ipaddress = resource . ipaddress ; unsetresource . td = resource . td ; return unsetresource . unset_resource ( client , args ) ; }
Use this API to unset the properties of nsip resource . Properties that need to be unset are specified in args array .
3,197
public static base_response enable ( nitro_service client , String ipaddress ) throws Exception { nsip enableresource = new nsip ( ) ; enableresource . ipaddress = ipaddress ; return enableresource . perform_operation ( client , "enable" ) ; }
Use this API to enable nsip of given name .
3,198
public static base_response enable ( nitro_service client , nsip resource ) throws Exception { nsip enableresource = new nsip ( ) ; enableresource . ipaddress = resource . ipaddress ; enableresource . td = resource . td ; return enableresource . perform_operation ( client , "enable" ) ; }
Use this API to enable nsip .
3,199
public static base_responses enable ( nitro_service client , String ipaddress [ ] ) throws Exception { base_responses result = null ; if ( ipaddress != null && ipaddress . length > 0 ) { nsip enableresources [ ] = new nsip [ ipaddress . length ] ; for ( int i = 0 ; i < ipaddress . length ; i ++ ) { enableresources [ i ] = new nsip ( ) ; enableresources [ i ] . ipaddress = ipaddress [ i ] ; } result = perform_operation_bulk_request ( client , enableresources , "enable" ) ; } return result ; }
Use this API to enable nsip resources of given names .