idx int64 0 165k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
134,100 | public SmbTransport getDc ( String domain , SmbExtendedAuthenticator authenticator , NtlmPasswordAuthentication auth ) throws SmbAuthException { if ( DISABLED ) return null ; try { UniAddress addr = UniAddress . getByName ( domain , true ) ; SmbTransport trans = SmbTransport . getSmbTransport ( addr , 0 ) ; DfsReferral... | >> SmbAuthenticator Fixed trusted domain issue . |
134,101 | public static boolean addAll ( LongCollection collection , long [ ] array ) { boolean changed = false ; for ( long element : array ) { changed |= collection . add ( element ) ; } return changed ; } | Add all elements in the array to the collection . |
134,102 | public static < T > T get ( T [ ] array , int index ) { return array != null && index >= 0 && index < array . length ? array [ index ] : null ; } | Get the element at the index in the array . |
134,103 | public static < T > T [ ] slice ( T [ ] array , int ... indexes ) { int length = indexes . length ; T [ ] slice = ObjectArrays . newArray ( array , length ) ; for ( int i = 0 ; i < length ; i ++ ) { slice [ i ] = array [ indexes [ i ] ] ; } return slice ; } | Get the elements in the array that are at the indexes . |
134,104 | public static < T > List < T > slice ( List < T > list , int ... indexes ) { List < T > slice = new ArrayList < > ( indexes . length ) ; for ( int i : indexes ) { slice . add ( list . get ( i ) ) ; } return slice ; } | Get the elements in the list that are at the indexes . |
134,105 | public static Class < ? > getClass ( Object obj ) { Class < ? > cls = obj . getClass ( ) ; return cls != Class . class ? cls : ( Class < ? > ) obj ; } | If the object is not a Class get its Class . Otherwise get the object as a Class . |
134,106 | public static Class < ? > getNamedClass ( Object obj ) { Class < ? > cls = getClass ( obj ) ; while ( cls != null && cls . isAnonymousClass ( ) ) { cls = cls . getEnclosingClass ( ) ; } return cls ; } | If the object is not a Class get its Class . Otherwise get the object as a Class . If the class is anonymous get a non - anonymous enclosing class . |
134,107 | public static Request request ( String url , String ... headers ) { Request . Builder request = new Request . Builder ( ) . url ( url ) ; if ( headers != null ) { int length = headers . length ; checkArgument ( length % 2 == 0 , "headers length must be a multiple of two" ) ; for ( int i = 0 ; i < length ; i += 2 ) { re... | Get a GET request for the URL and headers . |
134,108 | public Call call ( String url , String ... headers ) { return mCaller . newCall ( request ( url , headers ) ) ; } | Get a Call for a GET request for the URL and headers . |
134,109 | public Response response ( String url , String ... headers ) throws IOException { return call ( url , headers ) . execute ( ) ; } | Get a response to a GET request for the URL and headers . |
134,110 | public Response download ( String url , File destination ) throws IOException { return download ( url , destination , ( String [ ] ) null ) ; } | Download the resource at the URL and write it to the file . |
134,111 | public Response download ( String url , File destination , String ... headers ) throws IOException { try ( Response resp = response ( url , headers ) ) { if ( resp . isSuccessful ( ) ) { try ( BufferedSink sink = Okio . buffer ( Okio . sink ( destination ) ) ) { resp . body ( ) . source ( ) . readAll ( sink ) ; } } ret... | Download the resource at the URL with the headers and write it to the file . |
134,112 | public int getOffset ( ) { String value = getValue ( ) ; String superstring = getSuperstring ( ) ; return value != null && superstring != null ? superstring . indexOf ( value ) : - 1 ; } | Zero - based position of the first character of the substring within the superstring . |
134,113 | public String getString ( ) { StringBuffer buf = new StringBuffer ( ) ; for ( int i = 0 ; i != string . length ; i ++ ) { buf . append ( table [ ( string [ i ] >>> 4 ) % 0xf ] ) ; buf . append ( table [ string [ i ] & 0xf ] ) ; } return buf . toString ( ) ; } | UniversalStrings have characters which are 4 bytes long - for the moment we just return them in Hex ... |
134,114 | public static int clamp ( int value , int min , int max ) { return Math . min ( Math . max ( min , value ) , max ) ; } | Get the value if it is between min and max min if the value is less than min or max if the value is greater than max . |
134,115 | public static String normalise ( String s ) { if ( sDiacritics == null ) { sDiacritics = Pattern . compile ( "\\p{InCombiningDiacriticalMarks}+" ) ; } return sDiacritics . matcher ( Normalizer . normalize ( s , NFD ) ) . replaceAll ( "" ) . toUpperCase ( US ) ; } | Remove diacritics from the string and convert it to upper case . |
134,116 | public static String distance ( String latitudeColumn , String longitudeColumn , String latitudeCosineColumn , double latitude , double longitude , MeasureUnit unit , String alias ) { double degree = unit == MILE ? LATITUDE_DEGREE_MI : LATITUDE_DEGREE_KM ; return String . format ( ( Locale ) null , sDistance , degree ,... | Get a result column for the squared distance from the row coordinates to the supplied coordinates . SQLite doesn t have a square root core function so this must be applied in Java when reading the result column value . |
134,117 | public static void sleep ( long length , TimeUnit unit ) { try { unit . sleep ( length ) ; } catch ( InterruptedException e ) { Thread . currentThread ( ) . interrupt ( ) ; } } | Sleep for the length of time . |
134,118 | boolean matches ( SmbExtendedAuthenticator authenticator , NtlmPasswordAuthentication auth ) { return matcheObject ( this . authenticator , authenticator ) && matcheObject ( this . auth , auth ) ; } | authenticator to decide whether or not reuse a session . |
134,119 | Key searchSessionKey ( Subject subject ) throws GSSException { if ( extendedGSSContextClass == null || inquireTypeSessionKey == null || inquireSecContext == null || gssContext == null ) { if ( log . level > 0 && ( ! deprecationWarningPrinted ) ) { log . print ( "WARNING: Kerberos Session Key is extracted from Kerberos ... | Extract the context session key from the gssContext . The subject is only used if no support for extraction of the session key is not possible with an API and is used as a fallback method . |
134,120 | static protected int getPadBits ( int bitString ) { int val ; if ( bitString == 0 ) { return 7 ; } if ( bitString > 255 ) { val = ( ( bitString >> 8 ) & 0xFF ) ; } else { val = ( bitString & 0xFF ) ; } int bits = 1 ; while ( ( ( val <<= 1 ) & 0xFF ) != 0 ) { bits ++ ; } return 8 - bits ; } | return the correct number of pad bits for a bit string defined in a 16 bit constant |
134,121 | static protected byte [ ] getBytes ( int bitString ) { if ( bitString > 255 ) { byte [ ] bytes = new byte [ 2 ] ; bytes [ 0 ] = ( byte ) ( bitString & 0xFF ) ; bytes [ 1 ] = ( byte ) ( ( bitString >> 8 ) & 0xFF ) ; return bytes ; } else { byte [ ] bytes = new byte [ 1 ] ; bytes [ 0 ] = ( byte ) ( bitString & 0xFF ) ; r... | return the correct number of bytes for a bit string defined in a 16 bit constant |
134,122 | public static PreparedStatement setStrings ( PreparedStatement stmt , String ... params ) throws SQLException { return setStrings ( 1 , stmt , params ) ; } | Set the statement parameters starting at 1 in the order of the params . |
134,123 | public static int firstInt ( PreparedStatement stmt ) throws SQLException { ResultSet rs = stmt . executeQuery ( ) ; int i = rs . next ( ) ? rs . getInt ( 1 ) : Integer . MIN_VALUE ; stmt . close ( ) ; return i ; } | Execute the query get the int value in the first row and column of the result set and close the statement . |
134,124 | public static long firstLong ( PreparedStatement stmt ) throws SQLException { ResultSet rs = stmt . executeQuery ( ) ; long l = rs . next ( ) ? rs . getLong ( 1 ) : Long . MIN_VALUE ; stmt . close ( ) ; return l ; } | Execute the query get the long value in the first row and column of the result set and close the statement . |
134,125 | public static String firstString ( PreparedStatement stmt ) throws SQLException { ResultSet rs = stmt . executeQuery ( ) ; String s = rs . next ( ) ? rs . getString ( 1 ) : null ; stmt . close ( ) ; return s ; } | Execute the query get the String value in the first row and column of the result set and close the statement . |
134,126 | @ SuppressWarnings ( "unchecked" ) public static List < String > firstStringRow ( PreparedStatement stmt ) throws SQLException { return ( List < String > ) firstRow ( stmt , String . class ) ; } | Execute the query get the String values in the first row of the result set and close the statement . |
134,127 | @ SuppressWarnings ( "unchecked" ) public static List < String > allStrings ( PreparedStatement stmt ) throws SQLException { return ( List < String > ) all ( stmt , String . class ) ; } | Execute the query get the String values in the first column of the result set and close the statement . |
134,128 | public static int firstIntKey ( PreparedStatement stmt ) throws SQLException { stmt . execute ( ) ; ResultSet rs = stmt . getGeneratedKeys ( ) ; int key = rs . next ( ) ? rs . getInt ( 1 ) : 0 ; stmt . close ( ) ; return key ; } | Execute the insert statement get the first generated key as an int and close the statement . |
134,129 | public static long firstLongKey ( PreparedStatement stmt ) throws SQLException { stmt . execute ( ) ; ResultSet rs = stmt . getGeneratedKeys ( ) ; long key = rs . next ( ) ? rs . getLong ( 1 ) : 0L ; stmt . close ( ) ; return key ; } | Execute the insert statement get the first generated key as a long and close the statement . |
134,130 | public static int update ( PreparedStatement stmt ) throws SQLException { int rows = stmt . executeUpdate ( ) ; stmt . close ( ) ; return rows ; } | Execute the insert update or delete statement get the number of rows affected and close the statement . |
134,131 | public static Cpe parse ( String cpeString , boolean lenient ) throws CpeParsingException { if ( cpeString == null ) { throw new CpeParsingException ( "CPE String is null and cannot be parsed" ) ; } else if ( cpeString . regionMatches ( 0 , "cpe:/" , 0 , 5 ) ) { return parse22 ( cpeString , lenient ) ; } else if ( cpeS... | Parses a CPE String into an object with the option of parsing CPE 2 . 2 URI strings in lenient mode - allowing for CPE values that do not adhere to the specification . |
134,132 | protected static Cpe parse22 ( String cpeString , boolean lenient ) throws CpeParsingException { if ( cpeString == null || cpeString . isEmpty ( ) ) { throw new CpeParsingException ( "CPE String is null ir enpty - unable to parse" ) ; } CpeBuilder cb = new CpeBuilder ( ) ; String [ ] parts = cpeString . split ( ":" ) ;... | Parses a CPE 2 . 2 URI . |
134,133 | protected static void unpackEdition ( String edition , CpeBuilder cb , boolean lenient ) throws CpeParsingException { if ( edition == null || edition . isEmpty ( ) ) { return ; } try { String [ ] unpacked = edition . split ( "~" ) ; if ( edition . startsWith ( "~" ) ) { if ( unpacked . length > 1 ) { cb . wfEdition ( C... | In a CPE 2 . 2 URI the new fields from CPE 2 . 3 may be packed into the edition field . If present each field will be preceeded by a ~ . Example ~edition~swEdition~targetSw~targetHw~other . |
134,134 | protected static Cpe parse23 ( String cpeString , boolean lenient ) throws CpeParsingException { if ( cpeString == null || cpeString . isEmpty ( ) ) { throw new CpeParsingException ( "CPE String is null ir enpty - unable to parse" ) ; } CpeBuilder cb = new CpeBuilder ( ) ; Cpe23PartIterator cpe = new Cpe23PartIterator ... | Parses a CPE 2 . 3 Formatted String . |
134,135 | public static Status component ( String value ) { if ( value != null && ! value . isEmpty ( ) ) { if ( "\\-" . equals ( value ) ) { return Status . SINGLE_QUOTED_HYPHEN ; } for ( int x = 0 ; x < value . length ( ) ; x ++ ) { char c = value . charAt ( x ) ; if ( c == '?' && x > 0 && x < value . length ( ) - 1 && ! ( ( v... | Validates the component to ensure it meets the CPE 2 . 3 specification of allowed values . |
134,136 | private static long countCharacter ( String value , char c ) { return value . chars ( ) . filter ( s -> s == c ) . count ( ) ; } | Counts the number of times the char c is contained in the value . |
134,137 | public static Status cpe ( String value ) { if ( "cpe:2.3:" . regionMatches ( 0 , value , 0 , 8 ) ) { return formattedString ( value ) ; } return cpeUri ( value ) ; } | Validates the given CPE string value to ensure it is either a valid CPE URI or Formatted String . |
134,138 | public static String fromWellFormed ( String value ) { if ( value == null ) { return LogicalValue . ANY . getAbbreviation ( ) ; } StringBuilder buffer = new StringBuilder ( value ) ; char p = ' ' ; for ( int x = 0 ; x < buffer . length ( ) - 1 ; x ++ ) { char c = buffer . charAt ( x ) ; if ( c == '\\' && p != '\\' ) { ... | Transforms the given well formed string into a non - escaped string . A well formed string has all non - alphanumeric characters escaped with a backslash . |
134,139 | public static String wellFormedToFS ( Part value ) { if ( value == null ) { return LogicalValue . ANY . getAbbreviation ( ) ; } return value . getAbbreviation ( ) ; } | Encodes the given value into the CPE 2 . 3 Formatted String representation . |
134,140 | public static Pattern wellFormedToPattern ( String value ) { StringBuilder sb = new StringBuilder ( value . length ( ) + 4 ) ; for ( int x = 0 ; x < value . length ( ) ; x ++ ) { if ( value . charAt ( x ) == '*' ) { sb . append ( ".*" ) ; } else if ( value . charAt ( x ) == '?' ) { sb . append ( "." ) ; } else if ( val... | Converts a well formed string into a regular expression pattern . |
134,141 | private void validate ( String vendor1 , String product1 , String version1 , String update1 , String edition1 , String language1 , String swEdition1 , String targetSw1 , String targetHw1 , String other1 ) throws CpeValidationException { Status status = Validate . component ( vendor1 ) ; if ( ! status . isValid ( ) ) { ... | Validates the CPE attributes . |
134,142 | public String toCpe22Uri ( ) throws CpeEncodingException { StringBuilder sb = new StringBuilder ( "cpe:/" ) ; sb . append ( Convert . wellFormedToCpeUri ( part ) ) . append ( ":" ) ; sb . append ( Convert . wellFormedToCpeUri ( vendor ) ) . append ( ":" ) ; sb . append ( Convert . wellFormedToCpeUri ( product ) ) . app... | Converts the CPE into the CPE 2 . 2 URI format . |
134,143 | public String toCpe23FS ( ) { return String . format ( "cpe:2.3:%s:%s:%s:%s:%s:%s:%s:%s:%s:%s:%s" , Convert . wellFormedToFS ( part ) , Convert . wellFormedToFS ( vendor ) , Convert . wellFormedToFS ( product ) , Convert . wellFormedToFS ( version ) , Convert . wellFormedToFS ( update ) , Convert . wellFormedToFS ( edi... | Converts the CPE into the CPE 2 . 3 Formatted String . |
134,144 | public boolean matches ( ICpe target ) { boolean result = true ; result &= compareAttributes ( this . part , target . getPart ( ) ) ; result &= compareAttributes ( this . vendor , target . getWellFormedVendor ( ) ) ; result &= compareAttributes ( this . product , target . getWellFormedProduct ( ) ) ; result &= compareA... | Determines if the CPE matches the given target CPE . This does not follow the CPE 2 . 3 Specification exactly as there are cases where undefined comparisons will result in either true or false . For instance ANY will match m + wild cards and NA will return false when the target has m + wild cards . |
134,145 | private static boolean containsSpecialCharacter ( String value ) { for ( int x = 0 ; x < value . length ( ) ; x ++ ) { char c = value . charAt ( x ) ; if ( c == '?' || c == '*' ) { return true ; } else if ( c == '\\' ) { x += 1 ; } } return false ; } | Determines if the string has an unquoted special character . |
134,146 | public int compareTo ( Object o ) { if ( o instanceof ICpe ) { ICpe otherObject = ( ICpe ) o ; final int before = - 1 ; final int equal = 0 ; final int after = 1 ; if ( this == otherObject ) { return equal ; } int r = getPart ( ) . getAbbreviation ( ) . compareTo ( otherObject . getPart ( ) . getAbbreviation ( ) ) ; if... | CompareTo is used for sorting this does not implement any CPE Matching rules . |
134,147 | protected static int compareVersions ( String left , String right ) { int result = 0 ; final List < String > subLeft = splitVersion ( left ) ; final List < String > subRight = splitVersion ( right ) ; final int subMax = ( subLeft . size ( ) <= subRight . size ( ) ) ? subLeft . size ( ) : subRight . size ( ) ; for ( int... | Compare version numbers to obtain the correct ordering . |
134,148 | protected void reset ( ) { part = Part . ANY ; vendor = LogicalValue . ANY . getAbbreviation ( ) ; product = LogicalValue . ANY . getAbbreviation ( ) ; version = LogicalValue . ANY . getAbbreviation ( ) ; update = LogicalValue . ANY . getAbbreviation ( ) ; edition = LogicalValue . ANY . getAbbreviation ( ) ; language =... | Resets the CPE Builder to a clean state . |
134,149 | public void add ( E element ) { if ( element == null ) throw new NullPointerException ( ) ; if ( root == null ) { root = new MutableNode < > ( element ) ; } else { MutableNode < E > node = root ; while ( ! node . getElement ( ) . equals ( element ) ) { int distance = distance ( node . getElement ( ) , element ) ; Mutab... | Adds the given element to this tree if it s not already present . |
134,150 | public Set < Match < ? extends E > > search ( E query , int maxDistance ) { if ( query == null ) throw new NullPointerException ( ) ; if ( maxDistance < 0 ) throw new IllegalArgumentException ( "maxDistance must be non-negative" ) ; Metric < ? super E > metric = tree . getMetric ( ) ; Set < Match < ? extends E > > matc... | Searches the tree for elements whose distance from the given query is less than or equal to the given maximum distance . |
134,151 | public boolean isLogger ( String loggerName ) throws Exception { Address addr = Address . root ( ) . add ( SUBSYSTEM , LOGGING , LOGGER , loggerName ) ; return null != readResource ( addr ) ; } | Checks to see if there is already a logger with the given name . |
134,152 | public String getLoggerLevel ( String loggerName ) throws Exception { Address addr = Address . root ( ) . add ( SUBSYSTEM , LOGGING , LOGGER , loggerName ) ; return getStringAttribute ( "level" , addr ) ; } | Returns the level of the given logger . |
134,153 | public void setLoggerLevel ( String loggerName , String level ) throws Exception { final Address addr = Address . root ( ) . add ( SUBSYSTEM , LOGGING , LOGGER , loggerName ) ; final ModelNode request ; if ( isLogger ( loggerName ) ) { request = createWriteAttributeRequest ( "level" , level , addr ) ; } else { final St... | Sets the logger to the given level . If the logger does not exist yet it will be created . |
134,154 | public boolean isWebSubsystem ( ) throws Exception { Address addr = Address . root ( ) . add ( SUBSYSTEM , SUBSYSTEM_WEB ) ; return null != readResource ( addr ) ; } | Checks to see if the web subsystem exists . This should always exist unless the server is just starting up and its web subsystem has not even initialized yet . |
134,155 | public void setEnableWelcomeRoot ( boolean enableFlag ) throws Exception { final Address address = Address . root ( ) . add ( SUBSYSTEM , SUBSYSTEM_WEB , VIRTUAL_SERVER , DEFAULT_HOST ) ; final ModelNode req = createWriteAttributeRequest ( "enable-welcome-root" , Boolean . toString ( enableFlag ) , address ) ; final Mo... | The enable - welcome - root setting controls whether or not to deploy JBoss welcome - content application at root context . If you want to deploy your own app at the root context you need to disable the enable - welcome - root setting on the default host virtual server . If you want to show the JBoss welcome screen you... |
134,156 | public boolean isConnector ( String name ) throws Exception { final Address address = Address . root ( ) . add ( SUBSYSTEM , SUBSYSTEM_WEB , CONNECTOR , name ) ; return null != readResource ( address ) ; } | Checks to see if there is already a connector with the given name . |
134,157 | public ModelNode getConnector ( String name ) throws Exception { final Address address = Address . root ( ) . add ( SUBSYSTEM , SUBSYSTEM_WEB , CONNECTOR , name ) ; return readResource ( address , true ) ; } | Returns the connector node with all its attributes . Will be null if it doesn t exist . |
134,158 | public void changeConnector ( String connectorName , String attribName , String attribValue ) throws Exception { final Address address = Address . root ( ) . add ( SUBSYSTEM , SUBSYSTEM_WEB , CONNECTOR , connectorName ) ; final ModelNode op = createWriteAttributeRequest ( attribName , attribValue , address ) ; final Mo... | Use this to modify an attribute for an existing connector . |
134,159 | public void removeConnector ( String doomedConnectorName ) throws Exception { final Address address = Address . root ( ) . add ( SUBSYSTEM , SUBSYSTEM_WEB , CONNECTOR , doomedConnectorName ) ; if ( isConnector ( doomedConnectorName ) ) { remove ( address ) ; } return ; } | Removes the given web connector . |
134,160 | public static ModelNode createWriteAttributeRequest ( String attributeName , String attributeValue , Address address ) { final ModelNode op = createRequest ( WRITE_ATTRIBUTE , address ) ; op . get ( NAME ) . set ( attributeName ) ; setPossibleExpression ( op , VALUE , attributeValue ) ; return op ; } | Convienence method that allows you to create request that writes a single attribute s string value to a resource . |
134,161 | public static ModelNode createRequest ( String operation , Address address ) { return createRequest ( operation , address , null ) ; } | Convienence method that builds a partial operation request node . |
134,162 | public static ModelNode createRequest ( String operation , Address address , ModelNode extra ) { final ModelNode request = ( extra != null ) ? extra . clone ( ) : new ModelNode ( ) ; request . get ( OPERATION ) . set ( operation ) ; request . get ( ADDRESS ) . set ( address . getAddressNode ( ) ) ; return request ; } | Convienence method that builds a partial operation request node with additional node properties supplied by the given node . |
134,163 | public static ModelNode createBatchRequest ( ModelNode ... steps ) { final ModelNode composite = new ModelNode ( ) ; composite . get ( OPERATION ) . set ( BATCH ) ; composite . get ( ADDRESS ) . setEmptyList ( ) ; final ModelNode stepsNode = composite . get ( BATCH_STEPS ) ; for ( ModelNode step : steps ) { if ( step !... | Creates a batch of operations that can be atomically invoked . |
134,164 | public static ModelNode getResults ( ModelNode operationResult ) { if ( ! operationResult . hasDefined ( RESULT ) ) { return new ModelNode ( ) ; } return operationResult . get ( RESULT ) ; } | If the given node has results those results are returned in a ModelNode . Otherwise an empty node is returned . |
134,165 | public ModelNode execute ( ModelNode request ) throws Exception { ModelControllerClient mcc = getModelControllerClient ( ) ; return mcc . execute ( request , OperationMessageHandler . logging ) ; } | Convienence method that executes the request . |
134,166 | public void remove ( Address doomedAddr ) throws Exception { final ModelNode request = createRequest ( REMOVE , doomedAddr ) ; final ModelNode response = execute ( request ) ; if ( ! isSuccess ( response ) ) { throw new FailureException ( response , "Failed to remove resource at address [" + doomedAddr + "]" ) ; } retu... | Removes the resource at the given address . |
134,167 | public void deploy ( String deploymentName , InputStream content , boolean enabled , Set < String > serverGroups , boolean forceDeploy ) { if ( serverGroups == null ) { serverGroups = Collections . emptySet ( ) ; } DeploymentResult result = null ; try { DeploymentManager dm = DeploymentManager . Factory . create ( getM... | Uploads the content to the app server s content repository and then deploys the content . If this is to be used for app servers in domain mode you have to pass in one or more server groups . If this is to be used to deploy an app in a standalone server the server groups should be empty . |
134,168 | public void undeploy ( String deploymentName , Set < String > serverGroups , boolean removeContent ) { if ( serverGroups == null ) { serverGroups = Collections . emptySet ( ) ; } DeploymentResult result = null ; try { DeploymentManager dm = DeploymentManager . Factory . create ( getModelControllerClient ( ) ) ; Undeplo... | Undeploys an app . If an empty set of server groups is passed in this will assume we are operating on a standalone server . |
134,169 | public boolean isVault ( ) throws Exception { Address addr = Address . root ( ) . add ( CORE_SERVICE , VAULT ) ; final ModelNode queryNode = createRequest ( READ_RESOURCE , addr ) ; final ModelNode results = execute ( queryNode ) ; if ( isSuccess ( results ) ) { return true ; } return false ; } | Checks to see if there is already a vault configured . |
134,170 | public String getVaultClass ( ) throws Exception { Address addr = Address . root ( ) . add ( CORE_SERVICE , VAULT ) ; ModelNode vaultNode = readResource ( addr ) ; if ( vaultNode == null ) { return null ; } ModelNode codeNode = vaultNode . get ( "code" ) ; if ( codeNode == null ) { return null ; } return codeNode . asS... | Attempts to retrieve the configured class for the vault . This method will return null if no vault is configured or if the vault does not have a custom vault class . |
134,171 | public ModelNode createNewVaultRequest ( String className ) { String dmrTemplate = "" + "{" + "\"code\" => \"%s\"" + "}" ; String dmr = String . format ( dmrTemplate , className ) ; Address addr = Address . root ( ) . add ( CORE_SERVICE , VAULT ) ; final ModelNode request = ModelNode . fromString ( dmr ) ; request . ge... | Returns a ModelNode that can be used to create the vault . Callers are free to tweak the queue request that is returned if they so choose before asking the client to execute the request . |
134,172 | public void setEnableAdminConsole ( boolean enableFlag ) throws Exception { final Address address = Address . root ( ) . add ( CORE_SERVICE , CORE_SERVICE_MGMT , MGMT_INTERFACE , MGMT_INTERFACE_HTTP ) ; final ModelNode req = createWriteAttributeRequest ( "console-enabled" , Boolean . toString ( enableFlag ) , address )... | Allows the caller to turn on or off complete access for the app server s admin console . |
134,173 | public Properties getSystemProperties ( ) throws Exception { final String [ ] address = { CORE_SERVICE , PLATFORM_MBEAN , "type" , "runtime" } ; final ModelNode op = createReadAttributeRequest ( true , "system-properties" , Address . root ( ) . add ( address ) ) ; final ModelNode results = execute ( op ) ; if ( isSucce... | This returns the system properties that are set in the AS JVM . This is not the system properties in the JVM of this client object - it is actually the system properties in the remote JVM of the AS instance that the client is talking to . |
134,174 | public void setAppServerDefaultDeploymentScanEnabled ( boolean enabled ) throws Exception { final String [ ] addressArr = { SUBSYSTEM , DEPLOYMENT_SCANNER , SCANNER , "default" } ; final Address address = Address . root ( ) . add ( addressArr ) ; final ModelNode req = createWriteAttributeRequest ( "scan-enabled" , Bool... | Enabled or disables the default deployment scanner . |
134,175 | public String getAppServerDefaultDeploymentDir ( ) throws Exception { final String [ ] addressArr = { SUBSYSTEM , DEPLOYMENT_SCANNER , SCANNER , "default" } ; final Address address = Address . root ( ) . add ( addressArr ) ; final ModelNode resourceAttributes = readResource ( address ) ; if ( resourceAttributes == null... | Returns the location where the default deployment scanner is pointing to . This is where EARs WARs and the like are deployed to . |
134,176 | public void setAppServerDefaultDeploymentTimeout ( long secs ) throws Exception { final String [ ] addressArr = { SUBSYSTEM , DEPLOYMENT_SCANNER , SCANNER , "default" } ; final Address address = Address . root ( ) . add ( addressArr ) ; final ModelNode req = createWriteAttributeRequest ( "deployment-timeout" , Long . t... | Sets the deployment timeout of the default deployment scanner . If a deployment takes longer than this value it will fail . |
134,177 | public void setSystemProperty ( String name , String value ) throws Exception { final ModelNode request = createRequest ( ADD , Address . root ( ) . add ( SYSTEM_PROPERTY , name ) ) ; request . get ( VALUE ) . set ( value ) ; final ModelNode response = execute ( request ) ; if ( ! isSuccess ( response ) ) { throw new F... | Set a runtime system property in the JVM that is managed by JBossAS . |
134,178 | public void addExtension ( String name ) throws Exception { final ModelNode request = createRequest ( ADD , Address . root ( ) . add ( EXTENSION , name ) ) ; request . get ( MODULE ) . set ( name ) ; final ModelNode response = execute ( request ) ; if ( ! isSuccess ( response ) ) { throw new FailureException ( response... | Adds a new module extension to the core system . |
134,179 | public boolean isExtension ( String name ) throws Exception { return null != readResource ( Address . root ( ) . add ( EXTENSION , name ) ) ; } | Returns true if the given extension is already in existence . |
134,180 | public boolean isSubsystem ( String name ) throws Exception { return null != readResource ( Address . root ( ) . add ( SUBSYSTEM , name ) ) ; } | Returns true if the given subsystem is already in existence . |
134,181 | public void reload ( boolean adminOnly ) throws Exception { final ModelNode request = createRequest ( "reload" , Address . root ( ) ) ; request . get ( "admin-only" ) . set ( adminOnly ) ; final ModelNode response = execute ( request ) ; if ( ! isSuccess ( response ) ) { throw new FailureException ( response ) ; } retu... | Invokes the management reload operation which will shut down all the app server services and restart them again potentially in admin - only mode . This does not shutdown the JVM itself . |
134,182 | public void shutdown ( boolean restart ) throws Exception { final ModelNode request = createRequest ( "shutdown" , Address . root ( ) ) ; request . get ( "restart" ) . set ( restart ) ; final ModelNode response = execute ( request ) ; if ( ! isSuccess ( response ) ) { throw new FailureException ( response ) ; } return ... | Invokes the management shutdown operation that kills the JVM completely with System . exit . If restart is set to true the JVM will immediately be restarted again . If restart is false the JVM is killed and will stay down . Note that in either case the caller may not be returned to since the JVM in which this call is m... |
134,183 | public boolean isQueue ( String queueName ) throws Exception { Address addr = Address . root ( ) . add ( SUBSYSTEM , SUBSYSTEM_MESSAGING , HORNETQ_SERVER , "default" ) ; String haystack = JMS_QUEUE ; return null != findNodeInList ( addr , haystack , queueName ) ; } | Checks to see if there is already a queue with the given name . |
134,184 | public ModelNode createNewQueueRequest ( String name , Boolean durable , List < String > entryNames ) { String dmrTemplate = "" + "{" + "\"durable\" => \"%s\", " + "\"entries\" => [\"%s\"] " + "}" ; String dmr = String . format ( dmrTemplate , ( ( null == durable ) ? "true" : durable . toString ( ) ) , entryNames . get... | Returns a ModelNode that can be used to create a queue . Callers are free to tweak the queue request that is returned if they so choose before asking the client to execute the request . |
134,185 | @ SuppressWarnings ( "unchecked" ) public static < T > T [ ] cloneArray ( T [ ] original ) { if ( original == null ) { return null ; } try { Class < ? > clazz = original . getClass ( ) . getComponentType ( ) ; T [ ] copy = ( T [ ] ) Array . newInstance ( clazz , original . length ) ; if ( copy . length != 0 ) { Constru... | Performs a deep copy of the given array by calling a copy constructor to build clones of each array element . |
134,186 | public boolean isSecurityDomain ( String securityDomainName ) throws Exception { Address addr = Address . root ( ) . add ( SUBSYSTEM , SUBSYSTEM_SECURITY ) ; String haystack = SECURITY_DOMAIN ; return null != findNodeInList ( addr , haystack , securityDomainName ) ; } | Checks to see if there is already a security domain with the given name . |
134,187 | public void createNewSecureIdentitySecurityDomain72 ( String securityDomainName , String username , String password ) throws Exception { Address addr = Address . root ( ) . add ( SUBSYSTEM , SUBSYSTEM_SECURITY , SECURITY_DOMAIN , securityDomainName ) ; ModelNode addTopNode = createRequest ( ADD , addr ) ; addTopNode . ... | Create a new security domain using the SecureIdentity authentication method . This is used when you want to obfuscate a database password in the configuration . |
134,188 | public ModelNode getSecureIdentitySecurityDomainModuleOptions ( String securityDomainName ) throws Exception { Address addr = Address . root ( ) . add ( SUBSYSTEM , SUBSYSTEM_SECURITY , SECURITY_DOMAIN , securityDomainName , AUTHENTICATION , CLASSIC ) ; ModelNode authResource = readResource ( addr ) ; List < ModelNode ... | Given the name of an existing security domain that uses the SecureIdentity authentication method this returns the module options for that security domain authentication method . This includes the username and password of the domain . |
134,189 | public void removeSecurityDomain ( String securityDomainName ) throws Exception { if ( ! isSecurityDomain ( securityDomainName ) ) { return ; } final Address addr = Address . root ( ) . add ( SUBSYSTEM , SUBSYSTEM_SECURITY , SECURITY_DOMAIN , securityDomainName ) ; ModelNode removeSecurityDomainNode = createRequest ( R... | Convenience method that removes a security domain by name . Useful when changing the characteristics of the login modules . |
134,190 | public void createNewSecurityDomain ( String securityDomainName , LoginModuleRequest ... loginModules ) throws Exception { CoreJBossASClient coreClient = new CoreJBossASClient ( getModelControllerClient ( ) ) ; String serverVersion = coreClient . getAppServerVersion ( ) ; if ( serverVersion . startsWith ( "7.2" ) ) { c... | Creates a new security domain including one or more login modules . The security domain will be replaced if it exists . |
134,191 | public boolean securityDomainHasLoginModule ( String domainName , String moduleName ) throws Exception { Address addr = Address . root ( ) . add ( SUBSYSTEM , SUBSYSTEM_SECURITY , SECURITY_DOMAIN , domainName ) ; addr . add ( AUTHENTICATION , CLASSIC ) ; addr . add ( LOGIN_MODULE , moduleName ) ; ModelNode request = cr... | Check if a certain login module is present inside the passed security domain |
134,192 | private static < L > void populateMetricTypesForResourceType ( ResourceType . Builder < ? , L > resourceTypeBuilder , TypeSets . Builder < L > typeSetsBuilder ) { Map < Name , TypeSet < MetricType < L > > > metricTypeSets = typeSetsBuilder . getMetricTypeSets ( ) ; List < Name > metricSetNames = resourceTypeBuilder . g... | Given a resource type builder this will fill in its metric types . |
134,193 | public < N , S extends Session < L > > void discoverChildren ( Resource < L > parent , ResourceType < L > childType , Session < L > session , EndpointService < L , S > service , Consumer < Resource < L > > resourceConsumer ) { try { L parentLocation = parent != null ? parent . getLocation ( ) : null ; log . debugf ( "D... | Discovers children of the given type underneath the given parent . |
134,194 | public void doScrape ( ) throws Exception { MBeanServerConnection beanConn ; JMXConnector jmxc = null ; if ( jmxUrl . isEmpty ( ) ) { beanConn = ManagementFactory . getPlatformMBeanServer ( ) ; } else { Map < String , Object > environment = new HashMap < String , Object > ( ) ; if ( username != null && username . lengt... | Get a list of mbeans on host_port and scrape their values . |
134,195 | public boolean isCacheContainer ( String cacheContainerName ) throws Exception { Address addr = Address . root ( ) . add ( SUBSYSTEM , SUBSYSTEM_INFINISPAN ) ; String haystack = CACHE_CONTAINER ; return null != findNodeInList ( addr , haystack , cacheContainerName ) ; } | Checks to see if there is already a cache container with the given name . |
134,196 | public boolean isLocalCache ( String cacheContainerName , String localCacheName ) throws Exception { if ( ! isCacheContainer ( cacheContainerName ) ) { return false ; } Address addr = Address . root ( ) . add ( SUBSYSTEM , SUBSYSTEM_INFINISPAN , CACHE_CONTAINER , cacheContainerName ) ; String haystack = LOCAL_CACHE ; r... | Checks to see if there is already a local cache with the given name . |
134,197 | public boolean isJDBCDriver ( String jdbcDriverName ) throws Exception { Address addr = Address . root ( ) . add ( SUBSYSTEM , SUBSYSTEM_DATASOURCES ) ; String haystack = JDBC_DRIVER ; return null != findNodeInList ( addr , haystack , jdbcDriverName ) ; } | Checks to see if there is already a JDBC driver with the given name . |
134,198 | public boolean isDatasource ( String datasourceName ) throws Exception { Address addr = Address . root ( ) . add ( SUBSYSTEM , SUBSYSTEM_DATASOURCES ) ; String haystack = DATA_SOURCE ; return null != findNodeInList ( addr , haystack , datasourceName ) ; } | Checks to see if there is already a datasource with the given name . |
134,199 | public boolean isXADatasource ( String datasourceName ) throws Exception { Address addr = Address . root ( ) . add ( SUBSYSTEM , SUBSYSTEM_DATASOURCES ) ; String haystack = XA_DATA_SOURCE ; return null != findNodeInList ( addr , haystack , datasourceName ) ; } | Checks to see if there is already a XA datasource with the given name . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.