idx
int64
0
41.2k
question
stringlengths
74
4.04k
target
stringlengths
7
750
22,200
@ Help ( help = "Delete the PhysicalNetworkFunctionRecord of a NetworkServiceRecord with specific id" ) public void deletePhysicalNetworkFunctionRecord ( final String idNsr , final String idPnfr ) throws SDKException { String url = idNsr + "/pnfrecords" + "/" + idPnfr ; requestDelete ( url ) ; }
Deletes a specific PhysicalNetworkFunctionRecord .
22,201
@ Help ( help = "Create the PhysicalNetworkFunctionRecord of a NetworkServiceRecord with specific id" ) public PhysicalNetworkFunctionRecord postPhysicalNetworkFunctionRecord ( final String idNsr , final PhysicalNetworkFunctionRecord physicalNetworkFunctionRecord ) throws SDKException { String url = idNsr + "/pnfrecord...
Create a new PhysicalnetworkFunctionRecord and add it ot a NetworkServiceRecord .
22,202
@ Help ( help = "Update the PhysicalNetworkFunctionRecord of a NetworkServiceRecord with specific id" ) public PhysicalNetworkFunctionRecord updatePNFD ( final String idNsr , final String idPnfr , final PhysicalNetworkFunctionRecord physicalNetworkFunctionRecord ) throws SDKException { String url = idNsr + "/pnfrecords...
Updates a specific PhysicalNetworkFunctionRecord .
22,203
@ Help ( help = "Scales out/add a VNF to a running NetworkServiceRecord with specific id" ) public void restartVnfr ( final String idNsr , final String idVnfr , String imageName ) throws SDKException { HashMap < String , Serializable > jsonBody = new HashMap < > ( ) ; jsonBody . put ( "imageName" , imageName ) ; String...
Restarts a VNFR in a running NSR .
22,204
@ Help ( help = "Upgrades a VNFR to a defined VNFD in a running NSR with specific id" ) public void upgradeVnfr ( final String idNsr , final String idVnfr , final String idVnfd ) throws SDKException { HashMap < String , Serializable > jsonBody = new HashMap < > ( ) ; jsonBody . put ( "vnfdId" , idVnfd ) ; String url = ...
Upgrades a VNFR of a defined VNFD in a running NSR .
22,205
@ Help ( help = "Updates a VNFR to a defined VNFD in a running NSR with specific id" ) public void updateVnfr ( final String idNsr , final String idVnfr ) throws SDKException { String url = idNsr + "/vnfrecords" + "/" + idVnfr + "/update" ; requestPost ( url ) ; }
Updates a VNFR of a defined VNFD in a running NSR .
22,206
@ Help ( help = "Executes a script at runtime for a VNFR of a defined VNFD in a running NSR with specific id" ) public void executeScript ( final String idNsr , final String idVnfr , String script ) throws SDKException { String url = idNsr + "/vnfrecords" + "/" + idVnfr + "/execute-script" ; requestPost ( url , script ...
Executes a script at runtime for a VNFR of a defined VNFD in a running NSR .
22,207
@ Help ( help = "Resumes a NSR that failed while executing a script in a VNFR. The id in the URL specifies the Network Service Record that will be resumed." ) public void resume ( final String idNsr ) throws SDKException { String url = idNsr + "/resume" ; requestPost ( url ) ; }
Resumes a NSR that failed while executing a script in a VNFR . The id in the URL specifies the Network Service Record that will be resumed ..
22,208
public static Token [ ] parse ( String text , boolean optimize ) { if ( text == null ) { return null ; } if ( text . length ( ) == 0 ) { Token t = new Token ( text ) ; return new Token [ ] { t } ; } Token [ ] tokens = null ; List < Token > tokenList = Tokenizer . tokenize ( text , optimize ) ; if ( ! tokenList . isEmpt...
Returns an array of tokens that contains tokenized string .
22,209
public static Token [ ] makeTokens ( String text , boolean tokenize ) { if ( text == null ) { return null ; } Token [ ] tokens ; if ( tokenize ) { tokens = parse ( text ) ; } else { tokens = new Token [ 1 ] ; tokens [ 0 ] = new Token ( text ) ; } return tokens ; }
Convert the given string into tokens .
22,210
public static List < Token > tokenize ( CharSequence input , boolean textTrim ) { if ( input == null ) { throw new IllegalArgumentException ( "input must not be null" ) ; } int inputLen = input . length ( ) ; if ( inputLen == 0 ) { List < Token > tokens = new ArrayList < > ( 1 ) ; tokens . add ( new Token ( "" ) ) ; re...
Returns a list of tokens that contains tokenized string .
22,211
private static Token createToken ( char symbol , StringBuilder nameBuf , StringBuilder valueBuf ) { String value = null ; if ( valueBuf . length ( ) > 0 ) { value = valueBuf . toString ( ) ; valueBuf . setLength ( 0 ) ; } if ( nameBuf . length ( ) > 0 ) { TokenType type = Token . resolveTypeAsSymbol ( symbol ) ; String...
Create a token .
22,212
public static Token [ ] optimize ( Token [ ] tokens ) { if ( tokens == null ) { return null ; } String firstVal = null ; String lastVal = null ; if ( tokens . length == 1 ) { if ( tokens [ 0 ] . getType ( ) == TokenType . TEXT ) { firstVal = tokens [ 0 ] . getDefaultValue ( ) ; } } else if ( tokens . length > 1 ) { if ...
Returns an array of tokens that is optimized . Eliminates unnecessary white spaces for the first and last tokens .
22,213
private static String trimLeadingWhitespace ( String string ) { if ( string . isEmpty ( ) ) { return string ; } int start = 0 ; char c ; for ( int i = 0 ; i < string . length ( ) ; i ++ ) { c = string . charAt ( i ) ; if ( ! Character . isWhitespace ( c ) ) { start = i ; break ; } } if ( start == 0 ) { return string ; ...
Returns a string that contains a copy of a specified string without leading whitespaces .
22,214
private static String trimTrailingWhitespace ( String string ) { int end = 0 ; char c ; for ( int i = string . length ( ) - 1 ; i >= 0 ; i -- ) { c = string . charAt ( i ) ; if ( ! Character . isWhitespace ( c ) ) { end = i ; break ; } } if ( end == 0 ) { return string ; } return string . substring ( 0 , end + 1 ) ; }
Returns a string that contains a copy of a specified string without trailing whitespaces .
22,215
public InputSource resolveEntity ( String publicId , String systemId ) throws SAXException { if ( validating ) { try { InputSource source = null ; if ( publicId != null ) { String path = doctypeMap . get ( publicId . toUpperCase ( ) ) ; source = getInputSource ( path ) ; } if ( source == null && systemId != null ) { St...
Converts a public DTD into a local one .
22,216
public static Pointcut createPointcut ( PointcutRule pointcutRule ) { if ( pointcutRule . getPointcutType ( ) == PointcutType . REGEXP ) { return createRegexpPointcut ( pointcutRule . getPointcutPatternRuleList ( ) ) ; } else { return createWildcardPointcut ( pointcutRule . getPointcutPatternRuleList ( ) ) ; } }
Creates a new Pointcut instance .
22,217
@ SuppressWarnings ( "rawtypes" ) protected String parseStringParameter ( Map params , String paramName ) { Object paramModel = params . get ( paramName ) ; if ( paramModel == null ) { return null ; } if ( ! ( paramModel instanceof SimpleScalar ) ) { throw new IllegalArgumentException ( paramName + " must be string" ) ...
Parse string parameter .
22,218
@ SuppressWarnings ( "rawtypes" ) protected String [ ] parseSequenceParameter ( Map params , String paramName ) throws TemplateModelException { Object paramModel = params . get ( paramName ) ; if ( paramModel == null ) { return null ; } if ( ! ( paramModel instanceof SimpleSequence ) ) { throw new IllegalArgumentExcept...
Parse sequence parameter .
22,219
private List < String > transformSimpleSequenceAsStringList ( SimpleSequence sequence , String paramName ) throws TemplateModelException { List < String > list = new ArrayList < > ( ) ; int size = sequence . size ( ) ; for ( int i = 0 ; i < size ; i ++ ) { TemplateModel model = sequence . get ( i ) ; if ( ! ( model ins...
Transform simple sequence as string list .
22,220
public ItemRule newAttributeItemRule ( String attributeName ) { ItemRule itemRule = new ItemRule ( ) ; itemRule . setName ( attributeName ) ; addAttributeItemRule ( itemRule ) ; return itemRule ; }
Adds a new attribute rule with the specified name and returns it .
22,221
public static EchoActionRule newInstance ( String id , Boolean hidden ) { EchoActionRule echoActionRule = new EchoActionRule ( ) ; echoActionRule . setActionId ( id ) ; echoActionRule . setHidden ( hidden ) ; return echoActionRule ; }
Returns a new derived instance of EchoActionRule .
22,222
public static EnvironmentRule newInstance ( String profile ) { EnvironmentRule environmentRule = new EnvironmentRule ( ) ; environmentRule . setProfile ( profile ) ; return environmentRule ; }
Returns a new instance of EnvironmentRule .
22,223
public String getName ( Activity activity ) { if ( nameTokens != null && nameTokens . length > 0 ) { TokenEvaluator evaluator = new TokenExpression ( activity ) ; return evaluator . evaluateAsString ( nameTokens ) ; } else { return name ; } }
Gets the dispatch name .
22,224
public void setName ( String name ) { this . name = name ; List < Token > tokens = Tokenizer . tokenize ( name , true ) ; int tokenCount = 0 ; for ( Token t : tokens ) { if ( t . getType ( ) != TokenType . TEXT ) { tokenCount ++ ; } } if ( tokenCount > 0 ) { this . nameTokens = tokens . toArray ( new Token [ 0 ] ) ; } ...
Sets the dispatch name .
22,225
public static DispatchRule replicate ( DispatchRule dispatchRule ) { DispatchRule dr = new DispatchRule ( ) ; dr . setName ( dispatchRule . getName ( ) , dispatchRule . getNameTokens ( ) ) ; dr . setContentType ( dispatchRule . getContentType ( ) ) ; dr . setEncoding ( dispatchRule . getEncoding ( ) ) ; dr . setDefault...
Returns a new derived instance of DispatchRule .
22,226
public Session newSession ( String id ) { long created = System . currentTimeMillis ( ) ; Session session = sessionCache . newSession ( id , created , ( defaultMaxIdleSecs > 0 ? defaultMaxIdleSecs * 1000L : - 1 ) ) ; try { sessionCache . put ( id , session ) ; sessionsCreatedStats . increment ( ) ; for ( SessionListene...
Create an entirely new Session .
22,227
private Session removeSession ( String id ) { try { Session session = sessionCache . delete ( id ) ; if ( session != null ) { session . beginInvalidate ( ) ; for ( int i = sessionListeners . size ( ) - 1 ; i >= 0 ; i -- ) { sessionListeners . get ( i ) . sessionDestroyed ( session ) ; } } return session ; } catch ( Exc...
Remove session from manager .
22,228
public void addEventListener ( EventListener listener ) { if ( listener instanceof SessionListener ) { sessionListeners . add ( ( SessionListener ) listener ) ; } if ( listener instanceof SessionAttributeListener ) { sessionAttributeListeners . add ( ( SessionAttributeListener ) listener ) ; } }
Adds an event listener for session - related events .
22,229
public void removeEventListener ( EventListener listener ) { if ( listener instanceof SessionListener ) { sessionListeners . remove ( listener ) ; } if ( listener instanceof SessionAttributeListener ) { sessionAttributeListeners . remove ( listener ) ; } }
Removes an event listener for for session - related events .
22,230
private static String getMessage ( Collection < Object > brokenReferences ) { StringBuilder sb = new StringBuilder ( ) ; for ( Object o : brokenReferences ) { if ( sb . length ( ) > 0 ) { sb . append ( ", " ) ; } sb . append ( o ) ; } return "Unable to resolve reference to bean [" + sb . toString ( ) + "]" ; }
Gets the detail message .
22,231
public void parse ( RuleAppender ruleAppender ) throws Exception { InputStream inputStream = null ; try { ruleAppender . setNodeTracker ( parser . getNodeTracker ( ) ) ; inputStream = ruleAppender . getInputStream ( ) ; InputSource inputSource = new InputSource ( inputStream ) ; inputSource . setSystemId ( ruleAppender...
Parses the aspectran configuration .
22,232
private void addDescriptionNodelets ( ) { parser . setXpath ( "/aspectran/description" ) ; parser . addNodelet ( attrs -> { String style = attrs . get ( "style" ) ; parser . pushObject ( style ) ; } ) ; parser . addNodeEndlet ( text -> { String style = parser . popObject ( ) ; if ( style != null ) { text = TextStyler ....
Adds the description nodelets .
22,233
private void addSettingsNodelets ( ) { parser . setXpath ( "/aspectran/settings" ) ; parser . addNodeEndlet ( text -> { assistant . applySettings ( ) ; } ) ; parser . setXpath ( "/aspectran/settings/setting" ) ; parser . addNodelet ( attrs -> { String name = attrs . get ( "name" ) ; String value = attrs . get ( "value"...
Adds the settings nodelets .
22,234
private void addTypeAliasNodelets ( ) { parser . setXpath ( "/aspectran/typeAliases" ) ; parser . addNodeEndlet ( text -> { if ( StringUtils . hasLength ( text ) ) { Parameters parameters = new VariableParameters ( text ) ; for ( String alias : parameters . getParameterNameSet ( ) ) { assistant . addTypeAlias ( alias ,...
Adds the type alias nodelets .
22,235
private void addAppendNodelets ( ) { parser . setXpath ( "/aspectran/append" ) ; parser . addNodelet ( attrs -> { String file = attrs . get ( "file" ) ; String resource = attrs . get ( "resource" ) ; String url = attrs . get ( "url" ) ; String format = attrs . get ( "format" ) ; String profile = attrs . get ( "profile"...
Adds the append nodelets .
22,236
public static String getFullPath ( String filename ) { if ( filename == null ) { return null ; } int index = indexOfLastSeparator ( filename ) ; if ( index < 0 ) { return StringUtils . EMPTY ; } return filename . substring ( 0 , index ) ; }
Gets the path from a full filename .
22,237
public static boolean isValidFileExtension ( String filename , String allowedFileExtensions , String deniedFileExtensions ) { if ( filename == null ) { return false ; } String ext = getExtension ( filename ) . toLowerCase ( ) ; if ( allowedFileExtensions != null && ! allowedFileExtensions . isEmpty ( ) ) { if ( ext . l...
Checks whether the extension of the filename is valid . The extension check is case - sensitive on all platforms .
22,238
public static File getUniqueFile ( File srcFile , char extSeparator ) throws IOException { if ( srcFile == null ) { throw new IllegalArgumentException ( "srcFile must not be null" ) ; } String path = getFullPath ( srcFile . getCanonicalPath ( ) ) ; String name = removeExtension ( srcFile . getName ( ) ) ; String ext = ...
Returns a file name that does not overlap in the specified directory . If a duplicate file name exists it is returned by appending a number after the file name .
22,239
private void execute ( Command command , CommandLineParser lineParser ) { ConsoleWrapper wrappedConsole = new ConsoleWrapper ( console ) ; PrintWriter outputWriter = null ; try { ParsedOptions options = lineParser . parseOptions ( command . getOptions ( ) ) ; outputWriter = OutputRedirection . determineOutputWriter ( l...
Executes a command built into Aspectran Shell .
22,240
private void execute ( TransletCommandLine transletCommandLine ) { if ( transletCommandLine . getRequestName ( ) != null ) { try { service . translate ( transletCommandLine , console ) ; } catch ( TransletNotFoundException e ) { console . writeError ( "No command or translet mapped to '" + e . getTransletName ( ) + "'"...
Executes a Translet defined in Aspectran .
22,241
public void setBeanClass ( Class < ? > beanClass ) { this . beanClass = beanClass ; this . className = beanClass . getName ( ) ; this . factoryBean = FactoryBean . class . isAssignableFrom ( beanClass ) ; this . disposableBean = DisposableBean . class . isAssignableFrom ( beanClass ) ; this . initializableBean = Initia...
Sets the bean class .
22,242
public ItemRule newConstructorArgumentItemRule ( ) { ItemRule itemRule = new ItemRule ( ) ; itemRule . setAutoNamed ( true ) ; addConstructorArgumentItemRule ( itemRule ) ; return itemRule ; }
Adds a new constructor argument item rule and returns it .
22,243
public void addConstructorArgumentItemRule ( ItemRule constructorArgumentItemRule ) { if ( constructorArgumentItemRuleMap == null ) { constructorArgumentItemRuleMap = new ItemRuleMap ( ) ; } constructorArgumentItemRuleMap . putItemRule ( constructorArgumentItemRule ) ; }
Adds the constructor argument item rule .
22,244
public ItemRule newPropertyItemRule ( String propertyName ) { ItemRule itemRule = new ItemRule ( ) ; itemRule . setName ( propertyName ) ; addPropertyItemRule ( itemRule ) ; return itemRule ; }
Adds a new property rule with the specified name and returns it .
22,245
public void addPropertyItemRule ( ItemRule propertyItemRule ) { if ( propertyItemRuleMap == null ) { propertyItemRuleMap = new ItemRuleMap ( ) ; } propertyItemRuleMap . putItemRule ( propertyItemRule ) ; }
Adds the property item rule .
22,246
public void speak ( String text ) { if ( voice == null ) { throw new IllegalStateException ( "Cannot find a voice named " + voiceName ) ; } voice . speak ( text ) ; }
Synthesizes speech of the given text and plays immediately .
22,247
protected ActivityContext createActivityContext ( ContextRuleAssistant assistant ) throws BeanReferenceException , IllegalRuleException { initContextEnvironment ( assistant ) ; AspectranActivityContext activityContext = new AspectranActivityContext ( assistant . getContextEnvironment ( ) ) ; AspectRuleRegistry aspectRu...
Returns a new instance of ActivityContext .
22,248
private void initAspectRuleRegistry ( ContextRuleAssistant assistant ) { AspectRuleRegistry aspectRuleRegistry = assistant . getAspectRuleRegistry ( ) ; BeanRuleRegistry beanRuleRegistry = assistant . getBeanRuleRegistry ( ) ; TransletRuleRegistry transletRuleRegistry = assistant . getTransletRuleRegistry ( ) ; AspectA...
Initialize the aspect rule registry .
22,249
public String getPath ( Activity activity ) { if ( pathTokens != null && pathTokens . length > 0 ) { TokenEvaluator evaluator = new TokenExpression ( activity ) ; return evaluator . evaluateAsString ( pathTokens ) ; } else { return path ; } }
Gets the redirect path .
22,250
public void setPath ( String path ) { this . path = path ; List < Token > tokens = Tokenizer . tokenize ( path , true ) ; int tokenCount = 0 ; for ( Token t : tokens ) { if ( t . getType ( ) != TokenType . TEXT ) { tokenCount ++ ; } } if ( tokenCount > 0 ) { this . pathTokens = tokens . toArray ( new Token [ 0 ] ) ; } ...
Sets the redirect path .
22,251
public ItemRule newParameterItemRule ( String parameterName ) { ItemRule itemRule = new ItemRule ( ) ; itemRule . setName ( parameterName ) ; addParameterItemRule ( itemRule ) ; return itemRule ; }
Adds a new parameter rule with the specified name and returns it .
22,252
public void addParameterItemRule ( ItemRule parameterItemRule ) { if ( parameterItemRuleMap == null ) { parameterItemRuleMap = new ItemRuleMap ( ) ; } parameterItemRuleMap . putItemRule ( parameterItemRule ) ; }
Adds the parameter item rule .
22,253
public void setParameters ( Map < String , String > parameters ) { if ( parameters == null || parameters . isEmpty ( ) ) { this . parameterItemRuleMap = null ; } else { ItemRuleMap itemRuleMap = new ItemRuleMap ( ) ; for ( Map . Entry < String , String > entry : parameters . entrySet ( ) ) { ItemRule ir = new ItemRule ...
Sets the parameter map .
22,254
protected String formatMessage ( String msg , Object [ ] args , Locale locale ) { if ( msg == null || ( ! this . alwaysUseMessageFormat && ( args == null || args . length == 0 ) ) ) { return msg ; } MessageFormat messageFormat = null ; synchronized ( this . messageFormatsPerMessage ) { Map < Locale , MessageFormat > me...
Format the given message String using cached MessageFormats . By default invoked for passed - in default messages to resolve any argument placeholders found in them .
22,255
protected MessageFormat createMessageFormat ( String msg , Locale locale ) { return new MessageFormat ( ( msg != null ? msg : "" ) , locale ) ; }
Create a MessageFormat for the given message and Locale .
22,256
public static < T > T createInstance ( Class < T > cls ) { Constructor < T > ctor ; try { ctor = findConstructor ( cls ) ; } catch ( NoSuchMethodException e ) { throw new IllegalArgumentException ( "Class " + cls . getName ( ) + " has no default (no arg) constructor" ) ; } try { return ctor . newInstance ( ) ; } catch ...
Method that can be called to try to create an instantiate of specified type . Instantiation is done using default no - argument constructor .
22,257
public static < T > T createInstance ( Class < T > cls , Object ... args ) { Class < ? > [ ] argTypes = new Class < ? > [ args . length ] ; for ( int i = 0 ; i < args . length ; i ++ ) { argTypes [ i ] = args [ i ] . getClass ( ) ; } return createInstance ( cls , args , argTypes ) ; }
Method that can be called to try to create an instantiate of specified type .
22,258
public static < T > Constructor < T > findConstructor ( Class < T > cls , Class < ? > ... argTypes ) throws NoSuchMethodException { Constructor < T > ctor ; try { ctor = cls . getDeclaredConstructor ( argTypes ) ; } catch ( NoSuchMethodException e ) { throw e ; } catch ( Exception e ) { throw new IllegalArgumentExcepti...
Obtain an accessible constructor for the given class and parameters .
22,259
private static boolean isLoadable ( Class < ? > clazz , ClassLoader classLoader ) { try { return ( clazz == classLoader . loadClass ( clazz . getName ( ) ) ) ; } catch ( ClassNotFoundException ex ) { return false ; } }
Check whether the given class is loadable in the given ClassLoader .
22,260
public static Object invokeExactStaticMethod ( Class < ? > objectClass , String methodName ) throws NoSuchMethodException , IllegalAccessException , InvocationTargetException { return invokeExactStaticMethod ( objectClass , methodName , EMPTY_OBJECT_ARRAY , EMPTY_CLASS_PARAMETERS ) ; }
Invoke a static method that has no parameters .
22,261
private RequestContext createRequestContext ( final HttpServletRequest req ) { return new RequestContext ( ) { public String getCharacterEncoding ( ) { return req . getCharacterEncoding ( ) ; } public String getContentType ( ) { return req . getContentType ( ) ; } public int getContentLength ( ) { return req . getConte...
Creates a RequestContext needed by Jakarta Commons Upload .
22,262
public boolean matches ( CharSequence input ) { separatorCount = - 1 ; separatorIndex = 0 ; if ( input == null ) { this . input = null ; separatorFlags = null ; return false ; } this . input = input ; separatorFlags = new int [ input . length ( ) ] ; boolean result = matches ( pattern , input , separatorFlags ) ; if ( ...
Checks whether a string matches a given wildcard pattern .
22,263
private boolean isProfileActive ( String profile ) { validateProfile ( profile ) ; Set < String > currentActiveProfiles = doGetActiveProfiles ( ) ; return ( currentActiveProfiles . contains ( profile ) || ( currentActiveProfiles . isEmpty ( ) && doGetDefaultProfiles ( ) . contains ( profile ) ) ) ; }
Returns whether the given profile is active or if active profiles are empty whether the profile should be active by default .
22,264
protected void indent ( ) throws IOException { if ( prettyPrint ) { for ( int i = 0 ; i < indentDepth ; i ++ ) { writer . write ( indentString ) ; } } }
Write a tab character to a character stream .
22,265
public JsonWriter writeName ( String name ) throws IOException { indent ( ) ; writer . write ( escape ( name ) ) ; writer . write ( ":" ) ; if ( prettyPrint ) { writer . write ( " " ) ; } willWriteValue = true ; return this ; }
Writes a key name to a character stream .
22,266
public JsonWriter openSquareBracket ( ) throws IOException { if ( ! willWriteValue ) { indent ( ) ; } writer . write ( "[" ) ; nextLine ( ) ; indentDepth ++ ; willWriteValue = false ; return this ; }
Open a single square bracket .
22,267
public static String stringify ( Object object , boolean prettyPrint ) throws IOException { if ( prettyPrint ) { return stringify ( object , DEFAULT_INDENT_STRING ) ; } else { return stringify ( object , null ) ; } }
Converts an object to a JSON formatted string . If pretty - printing is enabled includes spaces tabs and new - lines to make the format more readable . The default indentation string is a tab character .
22,268
public static String stringify ( Object object , String indentString ) throws IOException { if ( object == null ) { return null ; } Writer out = new StringWriter ( ) ; JsonWriter jsonWriter = new JsonWriter ( out , indentString ) ; jsonWriter . write ( object ) ; jsonWriter . close ( ) ; return out . toString ( ) ; }
Converts an object to a JSON formatted string . If pretty - printing is enabled includes spaces tabs and new - lines to make the format more readable .
22,269
public void putSetting ( String name , String value ) throws IllegalRuleException { if ( StringUtils . isEmpty ( name ) ) { throw new IllegalRuleException ( "Default setting name can not be null" ) ; } DefaultSettingType settingType = DefaultSettingType . resolve ( name ) ; if ( settingType == null ) { throw new Illega...
Puts the setting value .
22,270
public String resolveAliasType ( String alias ) { String type = getAliasedType ( alias ) ; return ( type == null ? alias : type ) ; }
Returns a type of an aliased type that is defined by assigning the type to the alias . If aliased type is not found it returns alias .
22,271
private void setAssistantLocal ( AssistantLocal newAssistantLocal ) { this . assistantLocal = newAssistantLocal ; scheduleRuleRegistry . setAssistantLocal ( newAssistantLocal ) ; transletRuleRegistry . setAssistantLocal ( newAssistantLocal ) ; templateRuleRegistry . setAssistantLocal ( newAssistantLocal ) ; }
Sets the assistant local .
22,272
public AssistantLocal backupAssistantLocal ( ) { AssistantLocal oldAssistantLocal = assistantLocal ; AssistantLocal newAssistantLocal = assistantLocal . replicate ( ) ; setAssistantLocal ( newAssistantLocal ) ; return oldAssistantLocal ; }
Backup the assistant local .
22,273
public void resolveAdviceBeanClass ( AspectRule aspectRule ) throws IllegalRuleException { String beanIdOrClass = aspectRule . getAdviceBeanId ( ) ; if ( beanIdOrClass != null ) { Class < ? > beanClass = resolveBeanClass ( beanIdOrClass , aspectRule ) ; if ( beanClass != null ) { aspectRule . setAdviceBeanClass ( beanC...
Resolve bean class for the aspect rule .
22,274
public void resolveActionBeanClass ( BeanMethodActionRule beanMethodActionRule ) throws IllegalRuleException { String beanIdOrClass = beanMethodActionRule . getBeanId ( ) ; if ( beanIdOrClass != null ) { Class < ? > beanClass = resolveBeanClass ( beanIdOrClass , beanMethodActionRule ) ; if ( beanClass != null ) { beanM...
Resolve bean class for bean method action rule .
22,275
public void resolveFactoryBeanClass ( BeanRule beanRule ) throws IllegalRuleException { String beanIdOrClass = beanRule . getFactoryBeanId ( ) ; if ( beanRule . isFactoryOffered ( ) && beanIdOrClass != null ) { Class < ? > beanClass = resolveBeanClass ( beanIdOrClass , beanRule ) ; if ( beanClass != null ) { beanRule ....
Resolve bean class for factory bean rule .
22,276
public void resolveBeanClass ( ItemRule itemRule ) throws IllegalRuleException { Iterator < Token [ ] > it = ItemRule . tokenIterator ( itemRule ) ; if ( it != null ) { while ( it . hasNext ( ) ) { Token [ ] tokens = it . next ( ) ; if ( tokens != null ) { for ( Token token : tokens ) { resolveBeanClass ( token ) ; } }...
Resolve bean class .
22,277
public void resolveBeanClass ( Token [ ] tokens ) throws IllegalRuleException { if ( tokens != null ) { for ( Token token : tokens ) { resolveBeanClass ( token ) ; } } }
Resolve bean class for token .
22,278
public void resolveBeanClass ( AutowireRule autowireRule ) throws IllegalRuleException { if ( autowireRule . getTargetType ( ) == AutowireTargetType . FIELD ) { if ( autowireRule . isRequired ( ) ) { Class < ? > [ ] types = autowireRule . getTypes ( ) ; String [ ] qualifiers = autowireRule . getQualifiers ( ) ; reserve...
Resolve bean class for the autowire rule .
22,279
public void resolveBeanClass ( ScheduleRule scheduleRule ) throws IllegalRuleException { String beanId = scheduleRule . getSchedulerBeanId ( ) ; if ( beanId != null ) { Class < ? > beanClass = resolveBeanClass ( beanId , scheduleRule ) ; if ( beanClass != null ) { scheduleRule . setSchedulerBeanClass ( beanClass ) ; re...
Resolve bean class for the schedule rule .
22,280
public void resolveBeanClass ( TemplateRule templateRule ) throws IllegalRuleException { String beanId = templateRule . getEngineBeanId ( ) ; if ( beanId != null ) { Class < ? > beanClass = resolveBeanClass ( beanId , templateRule ) ; if ( beanClass != null ) { templateRule . setEngineBeanClass ( beanClass ) ; reserveB...
Resolve bean class for the template rule .
22,281
public Collection < BeanRule > getBeanRules ( ) { Collection < BeanRule > idBasedBeanRules = beanRuleRegistry . getIdBasedBeanRules ( ) ; Collection < Set < BeanRule > > typeBasedBeanRules = beanRuleRegistry . getTypeBasedBeanRules ( ) ; Collection < BeanRule > configurableBeanRules = beanRuleRegistry . getConfigurable...
Returns all bean rules .
22,282
protected MessageFormat resolveCode ( String code , Locale locale ) { MessageFormat messageFormat = null ; for ( int i = 0 ; messageFormat == null && i < this . basenames . length ; i ++ ) { ResourceBundle bundle = getResourceBundle ( this . basenames [ i ] , locale ) ; if ( bundle != null ) { messageFormat = getMessag...
Resolves the given message code as key in the registered resource bundles using a cached MessageFormat instance per message code .
22,283
protected ResourceBundle getResourceBundle ( String basename , Locale locale ) { if ( this . cacheMillis >= 0 ) { return doGetBundle ( basename , locale ) ; } else { Map < Locale , ResourceBundle > localeMap = this . cachedResourceBundles . get ( basename ) ; if ( localeMap != null ) { ResourceBundle bundle = localeMap...
Return a ResourceBundle for the given basename and code fetching already generated MessageFormats from the cache .
22,284
protected ResourceBundle doGetBundle ( String basename , Locale locale ) throws MissingResourceException { return ResourceBundle . getBundle ( basename , locale , getClassLoader ( ) , new MessageSourceControl ( ) ) ; }
Obtain the resource bundle for the given basename and Locale .
22,285
protected MessageFormat getMessageFormat ( ResourceBundle bundle , String code , Locale locale ) throws MissingResourceException { Map < String , Map < Locale , MessageFormat > > codeMap = this . cachedBundleMessageFormats . get ( bundle ) ; Map < Locale , MessageFormat > localeMap = null ; if ( codeMap != null ) { loc...
Return a MessageFormat for the given bundle and code fetching already generated MessageFormats from the cache .
22,286
public void addNodelet ( String xpath , NodeletAdder nodeletAdder ) { nodeletAdder . add ( xpath , this ) ; setXpath ( xpath ) ; }
Adds the nodelet .
22,287
private void parseMultipartFormData ( ) { String multipartFormDataParser = getSetting ( MULTIPART_FORM_DATA_PARSER_SETTING_NAME ) ; if ( multipartFormDataParser == null ) { throw new MultipartRequestParseException ( "The setting name 'multipartFormDataParser' for multipart " + "form data parsing is not specified. Pleas...
Parse the multipart form data .
22,288
public String getHeader ( String name ) { return ( headers != null ? headers . getFirst ( name ) : null ) ; }
Returns the value of the response header with the given name .
22,289
public Collection < String > getHeaders ( String name ) { return ( headers != null ? headers . get ( name ) : null ) ; }
Returns the values of the response header with the given name .
22,290
public void setHeader ( String name , String value ) { touchHeaders ( ) . set ( name , value ) ; }
Set the given single header value under the given header name .
22,291
public void addHeader ( String name , String value ) { touchHeaders ( ) . add ( name , value ) ; }
Add the given single header value to the current list of values for the given header .
22,292
private void setInactivityTimer ( long ms ) { if ( sessionInactivityTimer == null ) { sessionInactivityTimer = new SessionInactivityTimer ( sessionHandler . getScheduler ( ) , this ) ; } sessionInactivityTimer . setIdleTimeout ( ms ) ; }
Set the session inactivity timer .
22,293
protected void stopInactivityTimer ( ) { try ( Lock ignored = locker . lockIfNotHeld ( ) ) { if ( sessionInactivityTimer != null ) { sessionInactivityTimer . setIdleTimeout ( - 1 ) ; sessionInactivityTimer = null ; if ( log . isDebugEnabled ( ) ) { log . debug ( "Session inactivity timer stopped" ) ; } } } }
Stop the session inactivity timer .
22,294
protected boolean isExpiredAt ( long time ) { try ( Lock ignored = locker . lockIfNotHeld ( ) ) { checkValidForRead ( ) ; return sessionData . isExpiredAt ( time ) ; } }
Check to see if session has expired as at the time given .
22,295
protected boolean isIdleLongerThan ( int sec ) { long now = System . currentTimeMillis ( ) ; try ( Lock ignored = locker . lockIfNotHeld ( ) ) { return ( ( sessionData . getAccessedTime ( ) + ( sec * 1000 ) ) <= now ) ; } }
Check if the Session has been idle longer than a number of seconds .
22,296
protected void checkValidForWrite ( ) throws IllegalStateException { checkLocked ( ) ; if ( state == State . INVALID ) { throw new IllegalStateException ( "Not valid for write: session " + this ) ; } if ( state == State . INVALIDATING ) { return ; } if ( ! isResident ( ) ) { throw new IllegalStateException ( "Not valid...
Check that the session can be modified .
22,297
protected void checkValidForRead ( ) throws IllegalStateException { checkLocked ( ) ; if ( state == State . INVALID ) { throw new IllegalStateException ( "Invalid for read: session " + this ) ; } if ( state == State . INVALIDATING ) { return ; } if ( ! isResident ( ) ) { throw new IllegalStateException ( "Invalid for r...
Check that the session data can be read .
22,298
public void setName ( String name ) { if ( name . endsWith ( ARRAY_SUFFIX ) ) { this . name = name . substring ( 0 , name . length ( ) - 2 ) ; type = ItemType . ARRAY ; } else if ( name . endsWith ( MAP_SUFFIX ) ) { this . name = name . substring ( 0 , name . length ( ) - 2 ) ; type = ItemType . MAP ; } else { this . n...
Sets the name of the item .
22,299
public List < String > getValueList ( ) { if ( tokensList == null ) { return null ; } if ( tokensList . isEmpty ( ) ) { return new ArrayList < > ( ) ; } else { List < String > list = new ArrayList < > ( tokensList . size ( ) ) ; for ( Token [ ] tokens : tokensList ) { list . add ( TokenParser . toString ( tokens ) ) ; ...
Returns a list of string values of this item .