idx
int64
0
165k
question
stringlengths
73
4.15k
target
stringlengths
5
918
len_question
int64
21
890
len_target
int64
3
255
9,600
public static traceroute get ( nitro_service client , traceroute resource ) throws Exception { resource . validate ( "get" ) ; return ( ( traceroute [ ] ) resource . get_resources ( client ) ) [ 0 ] ; }
Use this operation to get the status of traceroute on a given device .
53
16
9,601
public static traceroute [ ] get_filtered ( nitro_service service , filtervalue [ ] filter ) throws Exception { traceroute obj = new traceroute ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; traceroute [ ] response = ( traceroute [ ] ) obj . getfiltered ( service , option ) ; return response ...
Use this API to fetch filtered set of traceroute resources . set the filter parameter values in filtervalue object .
85
23
9,602
public boolean isMatching ( MouseEvent event ) { return ( event != null ) && ! event . isConsumed ( ) && ( mouseModifiers . isNone ( ) || ( ( event . isPrimaryButtonDown ( ) == mouseButtons . isPrimary ( ) ) && ( event . isMiddleButtonDown ( ) == mouseButtons . isMiddle ( ) ) && ( event . isSecondaryButtonDown ( ) == m...
Check whether the given MouseEvent is matching the current properties .
179
12
9,603
private WebTarget configure ( String token , boolean debug , Logger log , int maxLog ) { Client client = ClientBuilder . newBuilder ( ) . register ( MultiPartFeature . class ) . register ( JsonProcessingFeature . class ) . build ( ) ; client . register ( HttpAuthenticationFeature . basic ( token , "" ) ) ; if ( debug )...
Configures this client by settings HTTP AUTH filter the REST URL and logging .
104
15
9,604
protected < JsonType extends JsonStructure , ValueType > ValueType invoke ( String operation , String id , String action , QueryClosure queryClosure , RequestClosure < JsonType > requestClosure , ResponseClosure < JsonType , ValueType > responseClosure ) { try { WebTarget ws = wsBase . path ( operation ) ; if ( id != n...
Performs a REST API invocation .
589
7
9,605
protected void checkApiToken ( String apiToken ) { if ( StringUtils . isBlank ( apiToken ) ) throw new MissingApiTokenException ( "Empty key" ) ; if ( apiToken . length ( ) != TOKEN_LENGTH ) throw new MissingApiTokenException ( "Wrong length" ) ; if ( ! apiToken . matches ( HEX_PATTERN ) ) throw new MissingApiTokenExce...
Syntax checks the API Token .
104
7
9,606
public boolean isValidToken ( ) { try { // Response response = wsBase.path(TEST_CONFIGS).request(MediaType.APPLICATION_JSON_TYPE).get(); // return response.getStatusInfo().getFamily() == Response.Status.Family.SUCCESSFUL; LoadZone zone = getLoadZone ( LoadZone . AMAZON_US_ASHBURN . uid ) ; return zone == LoadZone . AMA...
Returns true if we can successfully logon and fetch some data .
133
13
9,607
public LoadZone getLoadZone ( String id ) { return invoke ( LOAD_ZONES , id , null , null , new RequestClosure < JsonArray > ( ) { @ Override public JsonArray call ( Invocation . Builder request ) { return request . get ( JsonArray . class ) ; } } , new ResponseClosure < JsonArray , LoadZone > ( ) { @ Override public L...
Retrieves a load - zone .
119
8
9,608
public List < LoadZone > getLoadZone ( ) { return invoke ( LOAD_ZONES , new RequestClosure < JsonArray > ( ) { @ Override public JsonArray call ( Invocation . Builder request ) { return request . get ( JsonArray . class ) ; } } , new ResponseClosure < JsonArray , List < LoadZone > > ( ) { @ Override public List < LoadZ...
Retrieves all load - zones .
169
8
9,609
public DataStore getDataStore ( int id ) { return invoke ( DATA_STORES , id , new RequestClosure < JsonObject > ( ) { @ Override public JsonObject call ( Invocation . Builder request ) { return request . get ( JsonObject . class ) ; } } , new ResponseClosure < JsonObject , DataStore > ( ) { @ Override public DataStore ...
Retrieves a data store .
105
7
9,610
public List < DataStore > getDataStores ( ) { return invoke ( DATA_STORES , new RequestClosure < JsonArray > ( ) { @ Override public JsonArray call ( Invocation . Builder request ) { return request . get ( JsonArray . class ) ; } } , new ResponseClosure < JsonArray , List < DataStore > > ( ) { @ Override public List < ...
Retrieves all data stores .
171
7
9,611
public void deleteDataStore ( final int id ) { invoke ( DATA_STORES , id , new RequestClosure < JsonStructure > ( ) { @ Override public JsonStructure call ( Invocation . Builder request ) { Response response = request . delete ( ) ; if ( response . getStatusInfo ( ) . getFamily ( ) != Response . Status . Family . SUCCE...
Deletes a data store .
117
6
9,612
public DataStore createDataStore ( final File file , final String name , final int fromline , final DataStore . Separator separator , final DataStore . StringDelimiter delimiter ) { return invoke ( DATA_STORES , new RequestClosure < JsonObject > ( ) { @ Override public JsonObject call ( Invocation . Builder request ) {...
Creates a new data store .
248
7
9,613
public UserScenario getUserScenario ( int id ) { return invoke ( USER_SCENARIOS , id , new RequestClosure < JsonObject > ( ) { @ Override public JsonObject call ( Invocation . Builder request ) { return request . get ( JsonObject . class ) ; } } , new ResponseClosure < JsonObject , UserScenario > ( ) { @ Override publi...
Retrieves a user scenario .
112
7
9,614
public List < UserScenario > getUserScenarios ( ) { return invoke ( USER_SCENARIOS , new RequestClosure < JsonArray > ( ) { @ Override public JsonArray call ( Invocation . Builder request ) { return request . get ( JsonArray . class ) ; } } , new ResponseClosure < JsonArray , List < UserScenario > > ( ) { @ Override pu...
Retrieves all user scenarios .
180
7
9,615
public UserScenario createUserScenario ( final UserScenario scenario ) { return invoke ( USER_SCENARIOS , new RequestClosure < JsonObject > ( ) { @ Override public JsonObject call ( Invocation . Builder request ) { String json = scenario . toJSON ( ) . toString ( ) ; Entity < String > data = Entity . entity ( json , Me...
Creates a new user scenario .
153
7
9,616
public UserScenarioValidation getUserScenarioValidation ( int id ) { return invoke ( USER_SCENARIO_VALIDATIONS , id , new RequestClosure < JsonObject > ( ) { @ Override public JsonObject call ( Invocation . Builder request ) { return request . get ( JsonObject . class ) ; } } , new ResponseClosure < JsonObject , UserSc...
Retrieves a user scenario validation .
126
8
9,617
@ Override @ SuppressWarnings ( "unchecked" ) public void setModifiedBy ( USER modifiedBy ) { this . modifiedBy = assertNotNull ( modifiedBy , ( ) -> "Modified by is required" ) ; this . lastModifiedBy = defaultIfNull ( this . lastModifiedBy , this . modifiedBy ) ; }
Sets the user responsible for modifying this object .
77
10
9,618
public static br reboot ( nitro_service client , br resource ) throws Exception { return ( ( br [ ] ) resource . perform_operation ( client , "reboot" ) ) [ 0 ] ; }
Use this operation to reboot Repeater Instance .
43
10
9,619
public static br stop ( nitro_service client , br resource ) throws Exception { return ( ( br [ ] ) resource . perform_operation ( client , "stop" ) ) [ 0 ] ; }
Use this operation to stop Repeater Instance .
42
10
9,620
public static br force_reboot ( nitro_service client , br resource ) throws Exception { return ( ( br [ ] ) resource . perform_operation ( client , "force_reboot" ) ) [ 0 ] ; }
Use this operation to force reboot Repeater Instance .
48
11
9,621
public static br force_stop ( nitro_service client , br resource ) throws Exception { return ( ( br [ ] ) resource . perform_operation ( client , "force_stop" ) ) [ 0 ] ; }
Use this operation to force stop Repeater Instance .
46
11
9,622
public static br start ( nitro_service client , br resource ) throws Exception { return ( ( br [ ] ) resource . perform_operation ( client , "start" ) ) [ 0 ] ; }
Use this operation to start Repeater Instance .
42
10
9,623
public boolean isMatching ( GestureEvent event ) { return ( event != null ) && ! event . isConsumed ( ) && ( gestureModifiers . isNone ( ) || ( ( event . isAltDown ( ) == gestureModifiers . isAlt ( ) ) && ( event . isShiftDown ( ) == gestureModifiers . isShift ( ) ) && ( event . isControlDown ( ) == gestureModifiers . ...
Check whether the given GestureEvent is matching the current properties .
139
13
9,624
public static prune_policy get ( nitro_service client , prune_policy resource ) throws Exception { resource . validate ( "get" ) ; return ( ( prune_policy [ ] ) resource . get_resources ( client ) ) [ 0 ] ; }
Use this operation to get the prune policy to view number of days data to retain .
56
18
9,625
@ Override @ SuppressWarnings ( "unchecked" ) public < E > E search ( final Collection < E > collection ) { Assert . isInstanceOf ( collection , List . class , "The collection {0} must be an instance of java.util.List!" , ClassUtils . getClassName ( collection ) ) ; return doSearch ( ( List < E > ) collection ) ; }
Searches the Collection of elements in order to find the element or elements matching the criteria defined by the Matcher . The search operation expects the collection of elements to an instance of java . util . List an ordered collection of elements that are sorted according the natural ordering of the element s Compa...
87
62
9,626
public void close ( ) { refuseNewRequests . set ( true ) ; channel . close ( ) . awaitUninterruptibly ( ) ; channel . eventLoop ( ) . shutdownGracefully ( ) . awaitUninterruptibly ( ) ; }
Shuts down this client and releases the underlying associated resources .
53
12
9,627
protected FraggleFragment peek ( String tag ) { if ( fm != null ) { return ( FraggleFragment ) fm . findFragmentByTag ( tag ) ; } return new EmptyFragment ( ) ; }
Returns the first fragment in the stack with the tag tag .
50
12
9,628
protected void processAnimations ( FragmentAnimation animation , FragmentTransaction ft ) { if ( animation != null ) { if ( animation . isCompletedAnimation ( ) ) { ft . setCustomAnimations ( animation . getEnterAnim ( ) , animation . getExitAnim ( ) , animation . getPushInAnim ( ) , animation . getPopOutAnim ( ) ) ; }...
Processes the custom animations element adding them as required
170
10
9,629
protected void configureAdditionMode ( Fragment frag , int flags , FragmentTransaction ft , int containerId ) { if ( ( flags & DO_NOT_REPLACE_FRAGMENT ) != DO_NOT_REPLACE_FRAGMENT ) { ft . replace ( containerId , frag , ( ( FraggleFragment ) frag ) . getFragmentTag ( ) ) ; } else { ft . add ( containerId , frag , ( ( F...
Configures the way to add the Fragment into the transaction . It can vary from adding a new fragment to using a previous instance and refresh it or replacing the last one .
129
35
9,630
protected void performTransaction ( Fragment frag , int flags , FragmentTransaction ft , int containerId ) { configureAdditionMode ( frag , flags , ft , containerId ) ; ft . commitAllowingStateLoss ( ) ; }
Commits the transaction to the Fragment Manager .
49
10
9,631
protected FraggleFragment peek ( ) { if ( fm . getBackStackEntryCount ( ) > 0 ) { return ( ( FraggleFragment ) fm . findFragmentByTag ( fm . getBackStackEntryAt ( fm . getBackStackEntryCount ( ) - 1 ) . getName ( ) ) ) ; } else { return new EmptyFragment ( ) ; } }
Peeks the last fragment in the Fragment stack .
87
11
9,632
public void clear ( ) { if ( fm != null ) { fm . popBackStack ( null , FragmentManager . POP_BACK_STACK_INCLUSIVE ) ; } fm = null ; }
Clears fragment manager backstack and the fragment manager itself .
46
12
9,633
public void reattach ( String tag ) { final Fragment currentFragment = ( Fragment ) peek ( tag ) ; FragmentTransaction fragTransaction = fm . beginTransaction ( ) ; fragTransaction . detach ( currentFragment ) ; fragTransaction . attach ( currentFragment ) ; fragTransaction . commit ( ) ; }
Reattaches a Fragment
67
6
9,634
public Set < String > keys ( String pattern ) { Set < String > result = new TreeSet < String > ( ) ; for ( String key : keys ( ) ) { if ( key . matches ( pattern ) ) result . add ( key ) ; } return result ; }
Returns all keys matching the given pattern .
57
8
9,635
public String get ( String key , String defaultValue ) { String value = parameters . get ( key ) ; return StringUtils . isBlank ( value ) ? defaultValue : value ; }
Returns the value associated with the key or the given default value .
40
13
9,636
public static system_settings get ( nitro_service client ) throws Exception { system_settings resource = new system_settings ( ) ; resource . validate ( "get" ) ; return ( ( system_settings [ ] ) resource . get_resources ( client ) ) [ 0 ] ; }
Use this operation to get SDX system settings .
60
10
9,637
@ Override @ SuppressWarnings ( "unchecked" ) public < E > Comparator < E > getOrderBy ( ) { return ObjectUtils . defaultIfNull ( ComparatorHolder . get ( ) , ObjectUtils . defaultIfNull ( orderBy , ComparableComparator . INSTANCE ) ) ; }
Gets the Comparator used to order the elements in the collection .
70
14
9,638
@ Override @ SuppressWarnings ( "unchecked" ) public < E > E [ ] sort ( final E ... elements ) { sort ( new SortableArrayList ( elements ) ) ; return elements ; }
Sorts an array of elements as defined by the Comparator or as determined by the elements in the array if the elements are Comparable .
46
28
9,639
@ Override public < E > Sortable < E > sort ( final Sortable < E > sortable ) { try { sort ( configureComparator ( sortable ) . asList ( ) ) ; return sortable ; } finally { ComparatorHolder . unset ( ) ; } }
Sorts the List representation of the Sortable implementing object as defined by the orderBy Comparator or as determined by elements in the Sortable collection if the elements are Comparable .
61
36
9,640
@ SafeVarargs public static < T > @ NonNull Optional < T > first ( final @ NonNull Optional < T > ... optionals ) { return Arrays . stream ( optionals ) . filter ( Optional :: isPresent ) . findFirst ( ) . orElse ( Optional . empty ( ) ) ; }
Gets the first optional with a present value .
65
10
9,641
@ SuppressWarnings ( "unchecked" ) public static < T extends Searcher > T createSearcher ( final SearchType type ) { switch ( ObjectUtils . defaultIfNull ( type , SearchType . UNKNOWN_SEARCH ) ) { case BINARY_SEARCH : return ( T ) new BinarySearch ( ) ; case LINEAR_SEARCH : return ( T ) new LinearSearch ( ) ; default :...
Creates an instance of the Searcher interface implementing the searching algorithm based on the SearchType .
140
19
9,642
public static < T extends Searcher > T createSearcherElseDefault ( final SearchType type , final T defaultSearcher ) { try { return createSearcher ( type ) ; } catch ( IllegalArgumentException ignore ) { return defaultSearcher ; } }
Creates an instance of the Searcher interface implementing the searching algorithm based on the SearchType otherwise returns the provided default Searcher implementation if a Searcher based on the specified SearchType is not available .
54
40
9,643
private void balance ( ) { // only try to balance when we're not terminating if ( ! isTerminated ( ) ) { Set < Map . Entry < Thread , Tracking > > threads = liveThreads . entrySet ( ) ; long liveAvgTimeTotal = 0 ; long liveAvgCpuTotal = 0 ; long liveCount = 0 ; for ( Map . Entry < Thread , Tracking > e : threads ) { if...
Compute and set the optimal number of threads to use in this pool .
332
15
9,644
public void setMenu ( Menu menu ) { this . menu = menu ; RadialMenuItem . setupMenuButton ( this , radialMenuParams , ( menu != null ) ? menu . getGraphic ( ) : null , ( menu != null ) ? menu . getText ( ) : null , true ) ; }
Sets the menu model .
66
6
9,645
@ Override public < E > List < E > sort ( final List < E > elements ) { int size = elements . size ( ) ; // create the heap for ( int parentIndex = ( ( size - 2 ) / 2 ) ; parentIndex >= 0 ; parentIndex -- ) { siftDown ( elements , parentIndex , size - 1 ) ; } // swap the first and last elements in the heap of array sin...
Uses the Heap Sort algorithm to sort a List of elements as defined by the Comparator or as determined by the elements in the collection if the elements are Comparable .
152
35
9,646
protected < E > void siftDown ( final List < E > elements , final int startIndex , final int endIndex ) { int rootIndex = startIndex ; while ( ( rootIndex * 2 + 1 ) <= endIndex ) { int swapIndex = rootIndex ; int leftChildIndex = ( rootIndex * 2 + 1 ) ; int rightChildIndex = ( leftChildIndex + 1 ) ; if ( getOrderBy ( )...
Creates a binary heap with the list of elements with the largest valued element at the root followed by the next largest valued elements as parents down to the leafs .
202
33
9,647
public void fireChangeEvent ( ) { ChangeEvent event = createChangeEvent ( getSource ( ) ) ; for ( ChangeListener listener : this ) { listener . stateChanged ( event ) ; } }
Fires a ChangeEvent for the source Object notifying each registered ChangeListener of the change .
41
19
9,648
@ Override public < E > List < E > sort ( final List < E > elements ) { int elementsSize = elements . size ( ) ; if ( elementsSize <= getSizeThreshold ( ) ) { return getSorter ( ) . sort ( elements ) ; } else { int beginIndex = 1 ; int endIndex = ( elementsSize - 1 ) ; E pivotElement = elements . get ( 0 ) ; while ( be...
Uses the Quick Sort algorithm to sort a List of elements as defined by the Comparator or as determined by the elements in the collection if the elements are Comparable .
236
34
9,649
public void onBeforeAdd ( E value ) { long freeHeapSpace = RUNTIME . freeMemory ( ) + ( RUNTIME . maxMemory ( ) - RUNTIME . totalMemory ( ) ) ; // start flow control if we cross the threshold if ( freeHeapSpace < minimumHeapSpaceBeforeFlowControl ) { // x indicates how close we are to overflowing the heap long x = mini...
Block for a varying amount based on how close the system is to the max heap space . Only kick in when we have passed the percentOfHeapBeforeFlowControl threshold .
147
35
9,650
public void onAfterRemove ( E value ) { if ( value != null ) { dequeued ++ ; if ( dequeued % dequeueHint == 0 ) { RUNTIME . gc ( ) ; } } }
Increment the count of removed items from the queue . Calling this will optionally request that the garbage collector run to free up heap space for every nth dequeue where n is the value set for the dequeueHint .
47
45
9,651
public void propertyChange ( final PropertyChangeEvent event ) { if ( objectStateMap . containsKey ( event . getPropertyName ( ) ) ) { if ( objectStateMap . get ( event . getPropertyName ( ) ) == ObjectUtils . hashCode ( event . getNewValue ( ) ) ) { // NOTE the state of the property identified by the event has been re...
The event handler method that gets fired when a property of the Bean tracked by this ChangeTracker has been modified . The PropertyChangeEvent encapsulates all the information pertaining to the property change including the name of the property it s old and new value and the source Bean of the targeted change .
170
57
9,652
public void setResponse ( JsonRpcResponse response ) { if ( response . isError ( ) ) { setException ( response . error ( ) ) ; return ; } try { set ( ( V ) Messages . fromJson ( method . outputBuilder ( ) , response . result ( ) ) ) ; } catch ( Exception e ) { setException ( e ) ; } }
Sets the JSON response of this promise .
79
9
9,653
@ SuppressWarnings ( "unchecked" ) protected Class [ ] getArgumentTypes ( final Object ... arguments ) { Class [ ] argumentTypes = new Class [ arguments . length ] ; int index = 0 ; for ( Object argument : arguments ) { argumentTypes [ index ++ ] = ObjectUtils . defaultIfNull ( ClassUtils . getClass ( argument ) , Obje...
Determines the class types of the array of object arguments .
90
13
9,654
protected Constructor resolveConstructor ( final Class < ? > objectType , final Class ... parameterTypes ) { try { return objectType . getConstructor ( parameterTypes ) ; } catch ( NoSuchMethodException e ) { if ( ! ArrayUtils . isEmpty ( parameterTypes ) ) { Constructor constructor = resolveCompatibleConstructor ( obj...
Resolves the Class constructor with the given signature as determined by the parameter types .
176
16
9,655
@ SuppressWarnings ( "unchecked" ) protected Constructor resolveCompatibleConstructor ( final Class < ? > objectType , final Class < ? > [ ] parameterTypes ) { for ( Constructor constructor : objectType . getConstructors ( ) ) { Class [ ] constructorParameterTypes = constructor . getParameterTypes ( ) ; if ( parameterT...
Resolves the matching constructor for the specified Class type who s actual public constructor argument types are assignment compatible with the expected parameter types .
148
26
9,656
@ Override @ SuppressWarnings ( "unchecked" ) public < T > T create ( final String objectTypeName , final Object ... args ) { return ( T ) create ( ClassUtils . loadClass ( objectTypeName ) , getArgumentTypes ( args ) , args ) ; }
Creates an object given the fully qualified class name initialized with the specified constructor arguments . The parameter types of the constructor used to construct the object are determined from the arguments .
64
34
9,657
@ Override public < T > T create ( final Class < T > objectType , final Object ... args ) { return create ( objectType , getArgumentTypes ( args ) , args ) ; }
Creates an object given the class type initialized with the specified constructor arguments . The parameter types of the constructor used to construct the object are determined from the arguments .
42
32
9,658
private static int copyPathFragment ( char [ ] input , int beginIndex , StringBuilder output ) { int inputCharIndex = beginIndex ; while ( inputCharIndex < input . length ) { final char inputChar = input [ inputCharIndex ] ; if ( inputChar == ' ' ) { break ; } output . append ( inputChar ) ; inputCharIndex += 1 ; } ret...
Copy path fragment
86
3
9,659
public ListenableFuture < JsonRpcResponse > invoke ( JsonRpcRequest request ) { Service service = services . lookupByName ( request . service ( ) ) ; if ( service == null ) { JsonRpcError error = new JsonRpcError ( HttpResponseStatus . BAD_REQUEST , "Unknown service: " + request . service ( ) ) ; JsonRpcResponse respon...
Executes a request .
239
5
9,660
private < I extends Message , O extends Message > ListenableFuture < JsonRpcResponse > invoke ( ServerMethod < I , O > method , JsonObject parameter , JsonElement id ) { I request ; try { request = ( I ) Messages . fromJson ( method . inputBuilder ( ) , parameter ) ; } catch ( Exception e ) { serverLogger . logServerFa...
Actually invokes the server method .
163
7
9,661
protected synchronized void addContent ( Artifact record , String filename ) { if ( record != null ) { if ( filename . endsWith ( ".jar" ) ) { // this is an embedded archive embedded . add ( record ) ; } else { contents . add ( record ) ; } } }
Synchronized method for adding a new conent
59
10
9,662
protected void submitJob ( ExecutorService executor , Content file ) { // lifted from http://stackoverflow.com/a/5853198/1874604 class OneShotTask implements Runnable { Content file ; OneShotTask ( Content file ) { this . file = file ; } public void run ( ) { processContent ( file ) ; } } // we do not care about Future...
Helper method to sumit a new threaded tast to a given executor .
98
15
9,663
public static < T extends Comparable < T > > ComparableValueHolder < T > withComparableValue ( final T value ) { return new ComparableValueHolder <> ( value ) ; }
Factory method to construct an instance of the ValueHolder class with a Comparable value . The ValueHolder implementation itself implements the Comparable interface .
43
30
9,664
public static < T extends Cloneable > ValueHolder < T > withImmutableValue ( final T value ) { return new ValueHolder < T > ( ObjectUtils . clone ( value ) ) { @ Override public T getValue ( ) { return ObjectUtils . clone ( super . getValue ( ) ) ; } @ Override public void setValue ( final T value ) { super . setValue ...
Factory method to construct an instance of the ValueHolder class with an immutable Object value .
101
18
9,665
public static < T > ValueHolder < T > withNonNullValue ( final T value ) { Assert . notNull ( value , "The value must not be null!" ) ; return new ValueHolder < T > ( value ) { @ Override public void setValue ( final T value ) { Assert . notNull ( value , "The value must not be null!" ) ; super . setValue ( value ) ; }...
Factory method to construct an instance of the ValueHolder class with a non - null value .
94
19
9,666
public static xen reboot ( nitro_service client , xen resource ) throws Exception { return ( ( xen [ ] ) resource . perform_operation ( client , "reboot" ) ) [ 0 ] ; }
Use this operation to reboot XenServer .
43
8
9,667
public static xen stop ( nitro_service client , xen resource ) throws Exception { return ( ( xen [ ] ) resource . perform_operation ( client , "stop" ) ) [ 0 ] ; }
Use this operation to shutdown XenServer .
42
8
9,668
public static xen [ ] get_filtered ( nitro_service service , filtervalue [ ] filter ) throws Exception { xen obj = new xen ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; xen [ ] response = ( xen [ ] ) obj . getfiltered ( service , option ) ; return response ; }
Use this API to fetch filtered set of xen resources . set the filter parameter values in filtervalue object .
75
21
9,669
public static sdx_license get ( nitro_service client ) throws Exception { sdx_license resource = new sdx_license ( ) ; resource . validate ( "get" ) ; return ( ( sdx_license [ ] ) resource . get_resources ( client ) ) [ 0 ] ; }
Use this operation to get SDX license information .
64
10
9,670
@ Override public void visit ( final Visitable visitable ) { if ( visitable instanceof Auditable ) { modified |= ( ( Auditable ) visitable ) . isModified ( ) ; } }
Visits all Auditable Visitable objects in an object graph hierarchy in search of any modified objects .
44
20
9,671
public FilterBuilder < T > addWithAnd ( final Filter < T > filter ) { filterInstance = ComposableFilter . and ( filterInstance , filter ) ; return this ; }
Adds the specified Filter to the composition of Filters joined using the AND operator .
37
16
9,672
public FilterBuilder < T > addWithOr ( final Filter < T > filter ) { filterInstance = ComposableFilter . or ( filterInstance , filter ) ; return this ; }
Adds the specified Filter to the composition of Filters joined using the OR operator .
37
16
9,673
@ SuppressWarnings ( "unchecked" ) public static < T > T [ ] filter ( T [ ] array , Filter < T > filter ) { Assert . notNull ( array , "Array is required" ) ; Assert . notNull ( filter , "Filter is required" ) ; List < T > arrayList = stream ( array ) . filter ( filter :: accept ) . collect ( Collectors . toList ( ) ) ...
Filters the elements in the array .
134
8
9,674
@ SuppressWarnings ( "unchecked" ) public static < T > T [ ] filterAndTransform ( T [ ] array , FilteringTransformer < T > filteringTransformer ) { return transform ( filter ( array , filteringTransformer ) , filteringTransformer ) ; }
Filters and transforms the elements in the array .
59
10
9,675
@ SuppressWarnings ( "unchecked" ) public static < T > T [ ] insert ( T element , T [ ] array , int index ) { Assert . notNull ( array , "Array is required" ) ; assertThat ( index ) . throwing ( new ArrayIndexOutOfBoundsException ( String . format ( "[%1$d] is not a valid index [0, %2$d] in the array" , index , array ....
Inserts element into the array at index .
279
9
9,676
@ SuppressWarnings ( "unchecked" ) public static < T > T [ ] remove ( T [ ] array , int index ) { Assert . notNull ( array , "Array is required" ) ; assertThat ( index ) . throwing ( new ArrayIndexOutOfBoundsException ( String . format ( "[%1$d] is not a valid index [0, %2$d] in the array" , index , array . length ) ) ...
Removes the element at index from the given array .
244
11
9,677
public static < T > T [ ] sort ( T [ ] array , Comparator < T > comparator ) { Arrays . sort ( array , comparator ) ; return array ; }
Sorts the elements in the given array .
39
9
9,678
@ SuppressWarnings ( "unchecked" ) public static < T > T [ ] subArray ( T [ ] array , int ... indices ) { List < T > subArrayList = new ArrayList <> ( indices . length ) ; for ( int index : indices ) { subArrayList . add ( array [ index ] ) ; } return subArrayList . toArray ( ( T [ ] ) Array . newInstance ( array . get...
Creates a sub - array from the given array with elements at the specified indices in the given array .
115
21
9,679
public static < T > T [ ] swap ( T [ ] array , int indexOne , int indexTwo ) { T elementAtIndexOne = array [ indexOne ] ; array [ indexOne ] = array [ indexTwo ] ; array [ indexTwo ] = elementAtIndexOne ; return array ; }
Swaps elements in the array at indexOne and indexTwo .
63
13
9,680
public static void warnFormatted ( final Exception exception ) { logWriterInstance . warn ( exception ) ; UaiWebSocketLogManager . addLogText ( "[WARN] An exception just happened: " + exception . getMessage ( ) ) ; }
Wil log a text with the WARN level .
51
9
9,681
public static JsonObject toJson ( Message output ) { JsonObject object = new JsonObject ( ) ; for ( Map . Entry < Descriptors . FieldDescriptor , Object > field : output . getAllFields ( ) . entrySet ( ) ) { String jsonName = CaseFormat . LOWER_UNDERSCORE . to ( CaseFormat . LOWER_CAMEL , field . getKey ( ) . getName (...
Converts a proto - message into an equivalent JSON representation .
221
12
9,682
public static Message fromJson ( Message . Builder builder , JsonObject input ) throws Exception { Descriptors . Descriptor descriptor = builder . getDescriptorForType ( ) ; for ( Map . Entry < String , JsonElement > entry : input . entrySet ( ) ) { String protoName = CaseFormat . LOWER_CAMEL . to ( CaseFormat . LOWER_...
Converts a JSON object to a protobuf message
263
11
9,683
public static void bind ( final Context _ctx , final String _nameStr , final Object _object ) throws NamingException { final Name names = _ctx . getNameParser ( "" ) . parse ( _nameStr ) ; if ( names . size ( ) > 0 ) { Context subCtx = _ctx ; for ( int idx = 0 ; idx < names . size ( ) - 1 ; idx ++ ) { final String name...
Bing given object at the given name path within given name context .
285
14
9,684
protected Session getSession ( ) throws EFapsException { if ( this . session == null ) { try { String username = getProperties ( ) . get ( JCRStoreResource . PROPERTY_USERNAME ) ; if ( username == null ) { username = Context . getThreadContext ( ) . getPerson ( ) . getName ( ) ; } String passwd = getProperties ( ) . ge...
Gets the session for JCR access .
285
9
9,685
protected Node getFolderNode ( ) throws EFapsException , RepositoryException { Node ret = getSession ( ) . getRootNode ( ) ; if ( getProperties ( ) . containsKey ( JCRStoreResource . PROPERTY_BASEFOLDER ) ) { if ( ret . hasNode ( getProperties ( ) . get ( JCRStoreResource . PROPERTY_BASEFOLDER ) ) ) { ret = ret . getNo...
Gets the folder node .
242
6
9,686
protected Binary getBinary ( final InputStream _in ) throws EFapsException { Binary ret = null ; try { ret = SerialValueFactory . getInstance ( ) . createBinary ( _in ) ; } catch ( final RepositoryException e ) { throw new EFapsException ( "RepositoryException" , e ) ; } return ret ; }
Gets the binary .
73
5
9,687
protected void setIdentifer ( final String _identifier ) throws EFapsException { if ( ! _identifier . equals ( this . identifier ) ) { ConnectionResource res = null ; try { res = Context . getThreadContext ( ) . getConnectionResource ( ) ; final StringBuffer cmd = new StringBuffer ( ) . append ( "update " ) . append ( ...
Set the identifier in the eFaps DataBase .
253
11
9,688
@ Override public void rollback ( final Xid _xid ) throws XAException { try { getSession ( ) . logout ( ) ; } catch ( final EFapsException e ) { throw new XAException ( "EFapsException" ) ; } }
On rollback no save is send to the session ..
57
11
9,689
@ Override public final void initialize ( final Subject _subject , final CallbackHandler _callbackHandler , final Map < String , ? > _sharedState , final Map < String , ? > _options ) { XMLUserLoginModule . LOG . debug ( "Init" ) ; this . subject = _subject ; this . callbackHandler = _callbackHandler ; readPersons ( ( ...
Initialize this LoginModule .
94
6
9,690
@ SuppressWarnings ( "unchecked" ) private void readPersons ( final String _fileName ) { try { final File file = new File ( _fileName ) ; final Digester digester = new Digester ( ) ; digester . setValidating ( false ) ; digester . addObjectCreate ( "persons" , ArrayList . class ) ; digester . addObjectCreate ( "persons...
The name of the XML is store in this instance variable . The XML file holds all allowed persons and their related roles and groups .
786
26
9,691
private static boolean getAccessSetFromDB ( final String _sql , final Object _criteria ) throws CacheReloadException { boolean ret = false ; Connection con = null ; try { AccessSet accessSet = null ; con = Context . getConnection ( ) ; PreparedStatement stmt = null ; try { stmt = con . prepareStatement ( _sql ) ; stmt ...
Read the AccessSet from the DataBase .
430
9
9,692
public Table cloneTable ( ) { Table ret = null ; try { ret = ( Table ) super . clone ( ) ; } catch ( final CloneNotSupportedException e ) { e . printStackTrace ( ) ; } return ret ; }
Creates and returns a copy of this table object .
50
11
9,693
@ Override public void setIndex ( boolean b ) { if ( b ) { assert safe == null ; safe = type ; type = Typ . Int ; } else { assert type . getKind ( ) == TypeKind . INT ; assert safe != null ; type = safe ; safe = null ; } }
Set index parsing mode . In true mode we are parsing inside bracket where index type must be int .
63
20
9,694
public boolean hasEntries ( ) { return ( getCache4Id ( ) != null && ! getCache4Id ( ) . isEmpty ( ) ) || ( getCache4Name ( ) != null && ! getCache4Name ( ) . isEmpty ( ) ) || ( getCache4UUID ( ) != null && ! getCache4UUID ( ) . isEmpty ( ) ) ; }
The method tests if the cache has stored some entries .
84
11
9,695
public void initialize ( final Class < ? > _initializer ) { this . initializer = _initializer . getName ( ) ; synchronized ( this ) { try { readCache ( ) ; } catch ( final CacheReloadException e ) { AbstractCache . LOG . error ( "Unexpected error while initializing Cache for " + getClass ( ) , e ) ; } } }
The method initialize the cache .
80
6
9,696
public void clear ( ) { if ( getCache4Id ( ) != null ) { getCache4Id ( ) . clear ( ) ; } if ( getCache4Name ( ) != null ) { getCache4Name ( ) . clear ( ) ; } if ( getCache4UUID ( ) != null ) { getCache4UUID ( ) . clear ( ) ; } }
Clear all values of this Cache .
81
7
9,697
public static void clearCaches ( ) { synchronized ( AbstractCache . CACHES ) { for ( final AbstractCache < ? > cache : AbstractCache . CACHES ) { cache . getCache4Id ( ) . clear ( ) ; cache . getCache4Name ( ) . clear ( ) ; cache . getCache4UUID ( ) . clear ( ) ; } } }
The static method removes all values in all caches .
80
10
9,698
@ Override public void registerPropertyMatcher ( PropertyMatcher < ? > propertyMatcher ) { if ( propertyMatcher . getPathProvider ( ) == null ) { propertyMatcher . setPathProvider ( this ) ; } propertyMatcherList . add ( propertyMatcher ) ; }
Register a PropertyMatcher instance . Registered property matchers are used to generate the describeTo text . If a given property matcher does not have an assigned path provider this instance will be assigned .
61
39
9,699
@ Deprecated public Add add ( long projectId , String deviceId , String deviceName , String deviceType , Date created ) { return add ( projectId , new Device . Spec ( deviceId , deviceName , deviceType ) , created ) ; }
Creates an Add API request for a new Device with the provided data .
52
15