idx
int64
0
165k
question
stringlengths
73
5.81k
target
stringlengths
5
918
9,800
ComapiConfig buildComapiConfig ( ) { return new ComapiConfig ( ) . apiSpaceId ( apiSpaceId ) . authenticator ( authenticator ) . logConfig ( logConfig ) . apiConfiguration ( apiConfig ) . logSizeLimitKilobytes ( logSizeLimit ) . pushMessageListener ( pushMessageListener ) . fcmEnabled ( fcmEnabled ) ; }
Build config for foundation SDK initialisation .
9,801
int matchLength ( List < CharRange > prefix ) { DFAState < T > state = this ; int len = 0 ; for ( CharRange range : prefix ) { state = state . transit ( range ) ; if ( state == null ) { break ; } len ++ ; } return len ; }
Returns true if dfa starting from this state can accept a prefix constructed from a list of ranges
9,802
public int getTransitionSelectivity ( ) { int count = 0 ; for ( Transition < DFAState < T > > t : transitions . values ( ) ) { CharRange range = t . getCondition ( ) ; count += range . getTo ( ) - range . getFrom ( ) ; } return count / transitions . size ( ) ; }
Calculates a value of how selective transitions are from this state . Returns 1 if all ranges accept exactly one character . Greater number means less selectivity
9,803
public boolean hasBoundaryMatches ( ) { for ( Transition < DFAState < T > > t : transitions . values ( ) ) { CharRange range = t . getCondition ( ) ; if ( range . getFrom ( ) < 0 ) { return true ; } } return false ; }
Return true if one of transition ranges is a boundary match .
9,804
void optimizeTransitions ( ) { HashMap < DFAState < T > , RangeSet > hml = new HashMap < > ( ) ; for ( Transition < DFAState < T > > t : transitions . values ( ) ) { RangeSet rs = hml . get ( t . getTo ( ) ) ; if ( rs == null ) { rs = new RangeSet ( ) ; hml . put ( t . getTo ( ) , rs ) ; } rs . add ( t . getCondition (...
Optimizes transition by merging ranges
9,805
RangeSet possibleMoves ( ) { List < RangeSet > list = new ArrayList < > ( ) ; for ( NFAState < T > nfa : nfaSet ) { list . add ( nfa . getConditions ( ) ) ; } return RangeSet . split ( list ) ; }
Return a RangeSet containing all ranges
9,806
void removeDeadEndTransitions ( ) { Iterator < CharRange > it = transitions . keySet ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { CharRange r = it . next ( ) ; if ( transitions . get ( r ) . getTo ( ) . isDeadEnd ( ) ) { it . remove ( ) ; } } }
Removes transition to states that doesn t contain any outbound transition and that are not accepting states
9,807
boolean isDeadEnd ( ) { if ( isAccepting ( ) ) { return false ; } for ( Transition < DFAState < T > > next : transitions . values ( ) ) { if ( next . getTo ( ) != this ) { return false ; } } return true ; }
Returns true if state doesn t contain any outbound transition and is not accepting state
9,808
Set < NFAState < T > > nfaTransitsFor ( CharRange condition ) { Set < NFAState < T > > nset = new NumSet < > ( ) ; for ( NFAState < T > nfa : nfaSet ) { nset . addAll ( nfa . transit ( condition ) ) ; } return nset ; }
Returns a set of nfA states to where it is possible to move by nfa transitions .
9,809
void addTransition ( CharRange condition , DFAState < T > to ) { Transition < DFAState < T > > t = new Transition < > ( condition , this , to ) ; t = transitions . put ( t . getCondition ( ) , t ) ; assert t == null ; edges . add ( to ) ; to . inStates . add ( this ) ; }
Adds a new transition
9,810
private void load ( ) throws EFapsException { final QueryBuilder queryBldr = new QueryBuilder ( CIAdminCommon . MsgPhraseConfigAbstract ) ; queryBldr . addWhereAttrEqValue ( CIAdminCommon . MsgPhraseConfigAbstract . AbstractLink , getId ( ) ) ; final MultiPrintQuery multi = queryBldr . getPrint ( ) ; multi . addAttribu...
load the phrase .
9,811
void processBatchWaitTasks ( ) { Channel channel = context . registry . getChannelOrSystem ( Model . CHANNEL_BATCH ) ; int maxTask = context . taskManager . calcChannelBufferFree ( channel ) ; Map < String , Integer > channelSizes = new HashMap < String , Integer > ( ) ; channelSizes . put ( Model . CHANNEL_BATCH , max...
if finished then move this batchTask to his channel and then will be processed as regular task
9,812
public boolean send ( Whisper < ? > whisper ) { if ( isShutdown . get ( ) ) return false ; final ArrayDeque < Whisper < ? > > localQueue = ref . get ( ) ; if ( ! localQueue . isEmpty ( ) ) { localQueue . addLast ( whisper ) ; return true ; } localQueue . addLast ( whisper ) ; while ( ( whisper = localQueue . peekFirst ...
Send message and optionally wait response
9,813
public void shutdown ( ) { singleton = null ; log . info ( "Shuting down GossipMonger" ) ; isShutdown . set ( true ) ; threadPool . shutdown ( ) ; shutdownAndAwaitTermination ( threadPool ) ; ref . remove ( ) ; }
Shutdown GossipMonger and associated Threads
9,814
public RegexMatcher addExpression ( String expr , T attach , Option ... options ) { if ( nfa == null ) { nfa = parser . createNFA ( nfaScope , expr , attach , options ) ; } else { NFA < T > nfa2 = parser . createNFA ( nfaScope , expr , attach , options ) ; nfa = new NFA < > ( nfaScope , nfa , nfa2 ) ; } return this ; }
Add expression .
9,815
public T match ( CharSequence text , boolean matchPrefix ) { if ( root == null ) { throw new IllegalStateException ( "not compiled" ) ; } int length = text . length ( ) ; for ( int ii = 0 ; ii < length ; ii ++ ) { switch ( match ( text . charAt ( ii ) ) ) { case Error : return null ; case Ok : if ( matchPrefix ) { T un...
Matches given text . Returns associated token if match otherwise null . If matchPrefix is true returns also the only possible match .
9,816
public T match ( OfInt text ) { if ( root == null ) { throw new IllegalStateException ( "not compiled" ) ; } while ( text . hasNext ( ) ) { switch ( match ( text . nextInt ( ) ) ) { case Error : return null ; case Match : return getMatched ( ) ; } } return null ; }
Matches given text as int - iterator . Returns associated token if match otherwise null .
9,817
public static Stream < CharSequence > split ( CharSequence seq , String regex , Option ... options ) { return StreamSupport . stream ( new SpliteratorImpl ( seq , regex , options ) , false ) ; }
Returns stream that contains subsequences delimited by given regex
9,818
public boolean checkAndIncrease ( ) { long newTimestamp = System . currentTimeMillis ( ) ; if ( isShutdown ) { if ( newTimestamp > shutdownEndTime ) { isShutdown = false ; largeLimitCalls = 0 ; smallLimitCalls = 0 ; } else { return false ; } } if ( newTimestamp - smallLimitTimestamp > smallTimeFrame ) { smallLimitCalls...
Check if next call is allowed and increase the counts .
9,819
public static Method findMethod ( String name , Class < ? > cls ) { for ( Method method : cls . getDeclaredMethods ( ) ) { if ( method . getName ( ) . equals ( name ) ) { return method ; } } throw new ExecutionException ( "invalid auto-function: no '" + name + "' method declared" , null ) ; }
Finds a named declared method on the given class .
9,820
public static Object exec ( Method method , String [ ] paramNames , Map < String , ? > params , Object instance ) throws Throwable { Object [ ] paramValues = new Object [ paramNames . length ] ; for ( int c = 0 ; c < paramNames . length ; ++ c ) { paramValues [ c ] = params . get ( paramNames [ c ] ) ; } try { return m...
Invokes the given method mapping named parameters to positions based on a given list of parameter names .
9,821
protected void setLinkProperty ( final UUID _linkTypeUUID , final long _toId , final UUID _toTypeUUID , final String _toName ) throws EFapsException { setDirty ( ) ; }
Sets the link properties for this object .
9,822
public void addEvent ( final EventType _eventtype , final EventDefinition _eventdef ) throws CacheReloadException { List < EventDefinition > evenList = this . events . get ( _eventtype ) ; if ( evenList == null ) { evenList = new ArrayList < > ( ) ; this . events . put ( _eventtype , evenList ) ; } if ( ! evenList . co...
Adds a new event to this AdminObject .
9,823
public List < EventDefinition > getEvents ( final EventType _eventType ) { if ( ! this . eventChecked ) { this . eventChecked = true ; try { EventDefinition . addEvents ( this ) ; } catch ( final EFapsException e ) { AbstractAdminObject . LOG . error ( "Could not read events for Name:; {}', UUID: {}" , this . name , th...
Returns the list of events defined for given event type .
9,824
public boolean hasEvents ( final EventType _eventtype ) { if ( ! this . eventChecked ) { this . eventChecked = true ; try { EventDefinition . addEvents ( this ) ; } catch ( final EFapsException e ) { AbstractAdminObject . LOG . error ( "Could not read events for Name:; {}', UUID: {}" , this . name , this . uuid ) ; } }...
Does this instance have Event for the specified EventType ?
9,825
public Object call ( Map < String , ? > params ) throws Throwable { return AnnotatedExtensions . exec ( getCallMethod ( ) , getParameterNames ( ) , params , this ) ; }
Executes a method named doCall by mapping parameters by name to parameters annotated with the Named annotation
9,826
private Long getLanguageId ( final String _language ) { Long ret = null ; try { final QueryBuilder queryBldr = new QueryBuilder ( CIAdmin . Language ) ; queryBldr . addWhereAttrEqValue ( CIAdmin . Language . Language , _language ) ; final InstanceQuery query = queryBldr . getQuery ( ) ; query . executeWithoutAccessChec...
find out the Id of the language used for this properties .
9,827
private long insertNewLanguage ( final String _language ) { Long ret = null ; try { final Insert insert = new Insert ( CIAdmin . Language ) ; insert . add ( CIAdmin . Language . Language , _language ) ; insert . executeWithoutAccessCheck ( ) ; ret = insert . getId ( ) ; insert . close ( ) ; } catch ( final EFapsExcepti...
inserts a new language into the Database .
9,828
private Instance insertNewBundle ( ) { Instance ret = null ; try { final Insert insert = new Insert ( DBPropertiesUpdate . TYPE_PROPERTIES_BUNDLE ) ; insert . add ( "Name" , this . bundlename ) ; insert . add ( "UUID" , this . bundeluuid ) ; insert . add ( "Sequence" , this . bundlesequence ) ; insert . add ( "CacheOnS...
Insert a new Bundle into the Database .
9,829
private void importFromProperties ( final URL _url ) { try { final InputStream propInFile = _url . openStream ( ) ; final Properties props = new Properties ( ) ; props . load ( propInFile ) ; final Iterator < Entry < Object , Object > > iter = props . entrySet ( ) . iterator ( ) ; while ( iter . hasNext ( ) ) { final E...
Import Properties from a Properties - File as default if the key is already existing the default will be replaced with the new default .
9,830
private Instance getExistingLocale ( final long _propertyid , final String _language ) { Instance ret = null ; try { final QueryBuilder queryBldr = new QueryBuilder ( Type . get ( DBPropertiesUpdate . TYPE_PROPERTIES_LOCAL ) ) ; queryBldr . addWhereAttrEqValue ( "PropertyID" , _propertyid ) ; queryBldr . addWhereAttrEq...
Is a localized value already existing .
9,831
private void insertNewLocal ( final long _propertyid , final String _value , final String _language ) { try { final Insert insert = new Insert ( DBPropertiesUpdate . TYPE_PROPERTIES_LOCAL ) ; insert . add ( "Value" , _value ) ; insert . add ( "PropertyID" , _propertyid ) ; insert . add ( "LanguageID" , getLanguageId ( ...
Insert a new localized Value .
9,832
private void updateLocale ( final Instance _localeInst , final String _value ) { try { final Update update = new Update ( _localeInst ) ; update . add ( "Value" , _value ) ; update . execute ( ) ; } catch ( final EFapsException e ) { DBPropertiesUpdate . LOG . error ( "updateLocale(String, String)" , e ) ; } }
Update a localized Value .
9,833
private Instance getExistingKey ( final String _key ) { Instance ret = null ; try { final QueryBuilder queryBldr = new QueryBuilder ( Type . get ( DBPropertiesUpdate . TYPE_PROPERTIES ) ) ; queryBldr . addWhereAttrEqValue ( "Key" , _key ) ; queryBldr . addWhereAttrEqValue ( "BundleID" , this . bundleInstance ) ; final ...
Is a key already existing .
9,834
private void updateDefault ( final Instance _inst , final String _value ) { try { final Update update = new Update ( _inst ) ; update . add ( "Default" , _value ) ; update . execute ( ) ; } catch ( final EFapsException e ) { DBPropertiesUpdate . LOG . error ( "updateDefault(String, String)" , e ) ; } }
Update a Default .
9,835
private Instance insertNewProp ( final String _key , final String _value ) { Instance ret = null ; try { final Insert insert = new Insert ( DBPropertiesUpdate . TYPE_PROPERTIES ) ; insert . add ( "BundleID" , this . bundleInstance ) ; insert . add ( "Key" , _key ) ; insert . add ( "Default" , _value ) ; insert . execut...
Insert a new Property .
9,836
private Instance getExistingBundle ( final String _uuid ) { Instance ret = null ; try { final QueryBuilder queryBldr = new QueryBuilder ( Type . get ( DBPropertiesUpdate . TYPE_PROPERTIES_BUNDLE ) ) ; queryBldr . addWhereAttrEqValue ( "UUID" , _uuid ) ; final InstanceQuery query = queryBldr . getQuery ( ) ; query . exe...
Is the Bundle allready existing .
9,837
public boolean setPassword ( final String _name , final String _newpasswd , final String _oldpasswd ) throws LoginException { boolean ret = false ; final LoginContext login = new LoginContext ( this . application , new SetPasswordCallbackHandler ( ActionCallback . Mode . SET_PASSWORD , _name , _newpasswd , _oldpasswd )...
Set the password .
9,838
@ Action ( invokeOn = InvokeOn . OBJECT_AND_COLLECTION ) @ ActionLayout ( describedAs = "Toggle, for testing (direct) bulk actions" ) public void toggleForBulkActions ( ) { boolean flag = getFlag ( ) != null ? getFlag ( ) : false ; setFlag ( ! flag ) ; }
region > toggleForBulkActions
9,839
public boolean addMeasureToVerb ( Map < String , Object > properties ) { String [ ] pathKeys = { "verb" } ; return addChild ( "measure" , properties , pathKeys ) ; }
Add an arbitrary map of key - value pairs as a measure to the verb
9,840
public boolean addMeasureToVerb ( String measureType , Number value , Number scaleMin , Number scaleMax , Number sampleSize ) { Map < String , Object > container = new HashMap < String , Object > ( ) ; if ( measureType != null ) { container . put ( "measureType" , measureType ) ; } else { return false ; } if ( value !=...
Add a mesure object to the verb within this activity
9,841
public boolean addContextToVerb ( String objectType , String id , String description ) { Map < String , Object > container = new HashMap < String , Object > ( ) ; if ( objectType != null ) { container . put ( "objectType" , objectType ) ; } if ( id != null ) { container . put ( "id" , id ) ; } if ( description != null ...
Add a context object to the verb within this activity
9,842
public boolean addVerb ( String action , Date dateStart , Date dateEnd , String [ ] description , String comment ) { Map < String , Object > container = new HashMap < String , Object > ( ) ; if ( action != null ) { container . put ( "action" , action ) ; } else { return false ; } if ( dateStart != null && dateEnd != nu...
Add a verb object to this activity
9,843
public boolean addActor ( String objectType , String displayName , String url , String [ ] description ) { Map < String , Object > container = new HashMap < String , Object > ( ) ; if ( objectType != null ) { container . put ( "objectType" , objectType ) ; } else { return false ; } if ( displayName != null ) { containe...
Add an actor object to this activity
9,844
public boolean addObject ( String objectType , String id , String content ) { Map < String , Object > container = new HashMap < String , Object > ( ) ; if ( objectType != null ) { container . put ( "objectType" , objectType ) ; } if ( id != null ) { container . put ( "id" , id ) ; } if ( content != null ) { container ....
Add an object to this activity
9,845
public boolean addRelatedObject ( String objectType , String id , String content ) { Map < String , Object > container = new HashMap < String , Object > ( ) ; if ( objectType != null ) { container . put ( "objectType" , objectType ) ; } else { return false ; } if ( id != null ) { container . put ( "id" , id ) ; } if ( ...
Add a related object to this activity
9,846
private Map < String , Object > getMap ( String [ ] pathKeys ) { if ( pathKeys == null ) { return ( Map < String , Object > ) resourceData ; } Map < String , Object > selected = ( Map < String , Object > ) resourceData ; for ( int i = 0 ; i < pathKeys . length ; i ++ ) { if ( selected . containsKey ( pathKeys [ i ] ) &...
Get a map embedded in the activity following a set of keys
9,847
private boolean addChild ( String name , Object value , String [ ] pathKeys ) { Map < String , Object > selected = ( Map < String , Object > ) resourceData ; if ( pathKeys != null ) { selected = getMap ( pathKeys ) ; } if ( selected != null && ! selected . containsKey ( name ) ) { selected . put ( name , value ) ; retu...
Add a child object to the activity at the specified path
9,848
public void process ( TemplateImpl template , Writer out ) throws IOException { Environment env = new Environment ( template . getPath ( ) , out ) ; currentScope . declaringEnvironment = env ; Environment prevEnv = switchEnvironment ( env ) ; TemplateContext tmpl = template . getContext ( ) ; HeaderContext hdr = tmpl ....
Processes a template into its text representation
9,849
private TemplateImpl load ( String path , ParserRuleContext errCtx ) { path = Paths . resolvePath ( currentEnvironment . path , path ) ; try { return ( TemplateImpl ) engine . load ( path ) ; } catch ( IOException | ParseException e ) { throw new ExecutionException ( "error importing " + path , e , getLocation ( errCtx...
Loads a template from the supplied template loader .
9,850
private Environment switchEnvironment ( Environment env ) { Environment prev = currentEnvironment ; currentEnvironment = env ; return prev ; }
Switch to a new environment
9,851
private Scope switchScope ( Scope scope ) { Scope prev = currentScope ; currentScope = scope ; return prev ; }
Switch to a completely new scope stack
9,852
private Map < String , Object > bindBlocks ( PrepareSignatureContext sig , PrepareInvocationContext inv ) { if ( inv == null ) { return Collections . emptyMap ( ) ; } BlockDeclContext allDecl = null ; BlockDeclContext unnamedDecl = null ; List < NamedOutputBlockContext > namedBlocks = new ArrayList < > ( inv . namedBlo...
Bind block values to names based on prepare signature
9,853
private NamedOutputBlockContext findAndRemoveBlock ( List < NamedOutputBlockContext > blocks , String name ) { if ( blocks == null ) { return null ; } Iterator < NamedOutputBlockContext > blockIter = blocks . iterator ( ) ; while ( blockIter . hasNext ( ) ) { NamedOutputBlockContext block = blockIter . next ( ) ; Strin...
Find and remove block with specific name
9,854
private ExpressionContext findAndRemoveValue ( List < NamedValueContext > namedValues , String name ) { Iterator < NamedValueContext > namedValueIter = namedValues . iterator ( ) ; while ( namedValueIter . hasNext ( ) ) { NamedValueContext namedValue = namedValueIter . next ( ) ; if ( name . equals ( value ( namedValue...
Find and remove named value with specific name
9,855
private Object eval ( ExpressionContext expr ) { Object res = expr ; while ( res instanceof ExpressionContext ) res = ( ( ExpressionContext ) res ) . accept ( visitor ) ; if ( res instanceof LValue ) res = ( ( LValue ) res ) . get ( expr ) ; return res ; }
Evaluate an expression into a value
9,856
private List < Object > eval ( Iterable < ExpressionContext > expressions ) { List < Object > results = new ArrayList < Object > ( ) ; for ( ExpressionContext expression : expressions ) { results . add ( eval ( expression ) ) ; } return results ; }
Evaluates a list of expressions into their values
9,857
private Object exec ( StatementContext statement ) { if ( statement == null ) return null ; return statement . accept ( visitor ) ; }
Execute a statement block until the first return statement is reached .
9,858
ExecutionLocation getLocation ( ParserRuleContext object ) { Token start = object . getStart ( ) ; return new ExecutionLocation ( currentScope . declaringEnvironment . path , start . getLine ( ) , start . getCharPositionInLine ( ) + 1 ) ; }
Retrieves location information for a model object
9,859
public T find ( String text ) { T match = matcher . match ( text , true ) ; if ( match != null ) { String name = match . name ( ) ; if ( name . substring ( 0 , Math . min ( name . length ( ) , text . length ( ) ) ) . equalsIgnoreCase ( text ) ) { return match ; } } return null ; }
Returns enum for text if it is unique prefix .
9,860
public static void stop ( ) throws EFapsException { for ( final QueueConnection queCon : JmsHandler . QUEUE2QUECONN . values ( ) ) { try { queCon . close ( ) ; } catch ( final JMSException e ) { throw new EFapsException ( "JMSException" , e ) ; } } for ( final TopicConnection queCon : JmsHandler . TOPIC2QUECONN . value...
Stop the jms .
9,861
public static String getTimeoutMessage ( long timeout , TimeUnit unit ) { return String . format ( "Timeout of %d %s reached" , timeout , requireNonNull ( unit , "unit" ) ) ; }
Utility method that produce the message of the timeout .
9,862
protected void checkAccess ( ) throws EFapsException { for ( final Instance instance : getInstances ( ) ) { if ( ! instance . getType ( ) . hasAccess ( instance , AccessTypeEnums . DELETE . getAccessType ( ) , null ) ) { LOG . error ( "Delete not permitted for Person: {} on Instance: {}" , Context . getThreadContext ( ...
Check access for all Instances . If one does not have access an error will be thrown .
9,863
public void set ( double eyeX , double eyeY , double eyeZ , double centerX , double centerY , double centerZ , double upX , double upY , double upZ ) { this . eyeX = eyeX ; this . eyeY = eyeY ; this . eyeZ = eyeZ ; this . centerX = centerX ; this . centerY = centerY ; this . centerZ = centerZ ; this . upX = upX ; this ...
Sets the eye position the center of the scene and which axis is facing upward .
9,864
public void setEye ( double eyeX , double eyeY , double eyeZ ) { this . eyeX = eyeX ; this . eyeY = eyeY ; this . eyeZ = eyeZ ; }
Sets the eye position of this Camera .
9,865
public void setCenter ( double centerX , double centerY , double centerZ ) { this . centerX = centerX ; this . centerY = centerY ; this . centerZ = centerZ ; }
Sets the center of the scene of this Camera .
9,866
public void setOrientation ( double upX , double upY , double upZ ) { this . upX = upX ; this . upY = upY ; this . upZ = upZ ; }
Sets which axis is facing upward .
9,867
public double [ ] getCameraDirection ( ) { double [ ] cameraDirection = new double [ 3 ] ; double l = Math . sqrt ( Math . pow ( this . eyeX - this . centerX , 2.0 ) + Math . pow ( this . eyeZ - this . centerZ , 2.0 ) + Math . pow ( this . eyeZ - this . centerZ , 2.0 ) ) ; cameraDirection [ 0 ] = ( this . centerX - thi...
Gets the eye direction of this Camera .
9,868
protected boolean hasAccess ( ) throws EFapsException { return Context . getThreadContext ( ) . getPerson ( ) . isAssigned ( Role . get ( UUID . fromString ( "2d142645-140d-46ad-af67-835161a8d732" ) ) ) ; }
Check if the logged in users has access to rest . User must be assigned to the Role Admin_Rest .
9,869
protected String getJSONReply ( final Object _jsonObject ) { String ret = "" ; final ObjectMapper mapper = new ObjectMapper ( ) ; if ( LOG . isDebugEnabled ( ) ) { mapper . enable ( SerializationFeature . INDENT_OUTPUT ) ; } mapper . configure ( SerializationFeature . WRITE_DATES_AS_TIMESTAMPS , false ) ; mapper . regi...
Gets the JSON reply .
9,870
public static String login ( final String _userName , final String _passwd , final String _applicationKey ) throws EFapsException { String ret = null ; if ( JmsSession . checkLogin ( _userName , _passwd , _applicationKey ) ) { final JmsSession session = new JmsSession ( _userName ) ; JmsSession . CACHE . put ( session ...
Login and create a Session .
9,871
void update ( long index , int b ) { if ( size > 0 ) { assert index <= hi ; if ( index < lo ) { throw new IllegalStateException ( "lookaheadLength() too small in ChecksumProvider implementation" ) ; } hi = index ; if ( ( lo == hi - size ) ) { checksum . update ( lookahead [ ( int ) ( lo % size ) ] ) ; lo ++ ; } lookahe...
Update with character index .
9,872
public void execute ( ) throws InstallationException { Instance instance = searchInstance ( ) ; if ( instance == null ) { instance = createInstance ( ) ; } updateDB ( instance ) ; }
Import related source code into the eFaps DataBase . If the source code does not exists the source code is created in eFaps .
9,873
protected Instance createInstance ( ) throws InstallationException { final Insert insert ; try { insert = new Insert ( getCiType ( ) ) ; insert . add ( "Name" , this . programName ) ; if ( getEFapsUUID ( ) != null ) { insert . add ( "UUID" , getEFapsUUID ( ) . toString ( ) ) ; } insert . execute ( ) ; } catch ( final E...
Creates an instance of a source object in eFaps for given name .
9,874
public void updateDB ( final Instance _instance ) throws InstallationException { try { final InputStream is = newCodeInputStream ( ) ; final Checkin checkin = new Checkin ( _instance ) ; checkin . executeWithoutAccessCheck ( getProgramName ( ) , is , is . available ( ) ) ; } catch ( final UnsupportedEncodingException e...
Stores the read source code in eFaps . This is done with a check in .
9,875
public static void startup ( final String _classDBType , final String _classDSFactory , final String _propConnection , final String _classTM , final String _classTSR , final String _eFapsProps ) throws StartupException { StartupDatabaseConnection . startup ( _classDBType , _classDSFactory , StartupDatabaseConnection . ...
Initialize the database information set for given parameter values .
9,876
protected static void configureEFapsProperties ( final Context _compCtx , final Map < String , String > _eFapsProps ) throws StartupException { try { Util . bind ( _compCtx , "env/" + INamingBinds . RESOURCE_CONFIGPROPERTIES , _eFapsProps ) ; } catch ( final NamingException e ) { throw new StartupException ( "could not...
Add the eFaps Properties to the JNDI binding .
9,877
public static void shutdown ( ) throws StartupException { final Context compCtx ; try { final InitialContext context = new InitialContext ( ) ; compCtx = ( javax . naming . Context ) context . lookup ( "java:comp" ) ; } catch ( final NamingException e ) { throw new StartupException ( "Could not initialize JNDI" , e ) ;...
Shutdowns the connection to the database .
9,878
@ SuppressWarnings ( "unchecked" ) public STMT columnWithCurrentTimestamp ( final String _columnName ) { this . columnWithSQLValues . add ( new AbstractSQLInsertUpdate . ColumnWithSQLValue ( _columnName , Context . getDbType ( ) . getCurrentTimeStamp ( ) ) ) ; return ( STMT ) this ; }
Adds a new column which will have the current time stamp to append .
9,879
public static EQLInvoker getInvoker ( ) { final EQLInvoker ret = new EQLInvoker ( ) { protected AbstractPrintStmt getPrint ( ) { return new PrintStmt ( ) ; } protected AbstractInsertStmt getInsert ( ) { return new InsertStmt ( ) ; } protected AbstractExecStmt getExec ( ) { return new ExecStmt ( ) ; } protected Abstract...
Gets the invoker .
9,880
public void append2SQLSelect ( final SQLSelect _sqlSelect ) { if ( iWhere != null ) { final SQLWhere sqlWhere = _sqlSelect . getWhere ( ) ; for ( final IWhereTerm < ? > term : iWhere . getTerms ( ) ) { if ( term instanceof IWhereElementTerm ) { final IWhereElement element = ( ( IWhereElementTerm ) term ) . getElement (...
Append two SQL select .
9,881
void init ( ) { if ( ! isEnabled ( ) ) { loggerConfig . info ( "Ted prime instance check is disabled" ) ; return ; } this . primeTaskId = context . tedDaoExt . findPrimeTaskId ( ) ; int periodMs = context . config . intervalDriverMs ( ) ; this . postponeSec = ( int ) Math . round ( ( 1.0 * periodMs * TICK_SKIP_COUNT + ...
after configs read
9,882
public TemplateSource find ( String path ) throws IOException { return new URLTemplateSource ( new URL ( "file" , null , path ) ) ; }
Maps the given path to a file URL and builds a URLTemplateSource for it .
9,883
public static void initialize ( ) throws CacheReloadException { if ( InfinispanCache . get ( ) . exists ( BundleMaker . NAMECACHE ) ) { InfinispanCache . get ( ) . < UUID , Type > getCache ( BundleMaker . NAMECACHE ) . clear ( ) ; InfinispanCache . get ( ) . < UUID , Type > getCache ( BundleMaker . CACHE4BUNDLE ) . cle...
Init this class .
9,884
public static boolean containsKey ( final String _key ) { final Cache < String , BundleInterface > cache = InfinispanCache . get ( ) . < String , BundleInterface > getIgnReCache ( BundleMaker . CACHE4BUNDLE ) ; return cache . containsKey ( _key ) ; }
Does a Bundle for the Key exist .
9,885
private static String createNewKey ( final List < String > _names , final Class < ? > _bundleclass ) throws EFapsException { final StringBuilder builder = new StringBuilder ( ) ; final List < String > oids = new ArrayList < > ( ) ; String ret = null ; try { for ( final String name : _names ) { if ( builder . length ( )...
Creates a new Key and instantiates the BundleInterface .
9,886
public static void init ( final String _runLevel ) throws EFapsException { RunLevel . ALL_RUNLEVELS . clear ( ) ; RunLevel . RUNLEVEL = new RunLevel ( _runLevel ) ; }
The static method first removes all values in the caches . Then the cache is initialized automatically depending on the desired RunLevel
9,887
private List < String > getAllInitializers ( ) { final List < String > ret = new ArrayList < > ( ) ; for ( final CacheMethod cacheMethod : this . cacheMethods ) { ret . add ( cacheMethod . className ) ; } if ( this . parent != null ) { ret . addAll ( this . parent . getAllInitializers ( ) ) ; } return ret ; }
Returns the list of all initializers .
9,888
protected void initialize ( final String _sql ) throws EFapsException { Connection con = null ; try { con = Context . getConnection ( ) ; Statement stmt = null ; long parentId = 0 ; try { stmt = con . createStatement ( ) ; ResultSet rs = stmt . executeQuery ( _sql ) ; if ( rs . next ( ) ) { this . id = rs . getLong ( 1...
Reads the id and the parent id of this RunLevel . All defined methods for this run level are loaded . If a parent id is defined the parent is initialized .
9,889
static Integer getInteger ( Properties properties , String key , Integer defaultValue ) { if ( properties == null ) return defaultValue ; String value = properties . getProperty ( key ) ; if ( value == null || value . isEmpty ( ) ) return defaultValue ; int intVal ; try { intVal = Integer . parseInt ( value ) ; } catch...
returns int value of property or defaultValue if not found or invalid
9,890
public void execute ( T target ) throws Throwable { try { for ( Invokation invokation : queue ) { invokation . invoke ( target ) ; } } catch ( InvocationTargetException ex ) { throw ex . getCause ( ) ; } catch ( ReflectiveOperationException ex ) { throw new RuntimeException ( ex ) ; } }
Executes delayed invocations
9,891
protected Map < String , Object > getSignableData ( ) { final Map < String , Object > doc = getSendableData ( ) ; for ( int i = 0 ; i < excludedFields . length ; i ++ ) { doc . remove ( excludedFields [ i ] ) ; } return doc ; }
Builds and returns a map of the envelope data suitable for signing with the included signer
9,892
protected Map < String , Object > getSendableData ( ) { Map < String , Object > doc = new LinkedHashMap < String , Object > ( ) ; MapUtil . put ( doc , docTypeField , docType ) ; MapUtil . put ( doc , docVersionField , docVersion ) ; MapUtil . put ( doc , activeField , true ) ; MapUtil . put ( doc , resourceDataTypeFie...
Builds and returns a map of the envelope data including any signing data suitable for sending to a Learning Registry node
9,893
public void addSigningData ( String signingMethod , String publicKeyLocation , String clearSignedMessage ) { this . signingMethod = signingMethod ; this . publicKeyLocation = publicKeyLocation ; this . clearSignedMessage = clearSignedMessage ; this . signed = true ; }
Adds signing data to the envelope
9,894
public String getUrl ( String email ) { if ( email == null ) { throw new IllegalArgumentException ( "Email can't be null." ) ; } String emailHash = DigestUtils . md5Hex ( email . trim ( ) . toLowerCase ( ) ) ; boolean firstParameter = true ; StringBuilder builder = new StringBuilder ( 91 ) . append ( https ? HTTPS_URL ...
Retrieve the gravatar URL for the given email .
9,895
private void setProperties ( final Instance _instance ) throws EFapsException { final QueryBuilder queryBldr = new QueryBuilder ( CIAdminCommon . Property ) ; queryBldr . addWhereAttrEqValue ( CIAdminCommon . Property . Abstract , _instance . getId ( ) ) ; final MultiPrintQuery multi = queryBldr . getPrint ( ) ; multi ...
Set the properties in the superclass .
9,896
private void checkProgramInstance ( ) { try { if ( EventDefinition . LOG . isDebugEnabled ( ) ) { EventDefinition . LOG . debug ( "checking Instance: {} - {}" , this . resourceName , this . methodName ) ; } if ( ! EFapsClassLoader . getInstance ( ) . isOffline ( ) ) { final Class < ? > cls = Class . forName ( this . re...
Method to check if the instance of the esjp is valid .
9,897
public Return execute ( final Parameter _parameter ) throws EFapsException { Return ret = null ; _parameter . put ( ParameterValues . PROPERTIES , new HashMap < > ( super . evalProperties ( ) ) ) ; try { EventDefinition . LOG . debug ( "Invoking method '{}' for Resource '{}'" , this . methodName , this . resourceName )...
Method to execute the esjp .
9,898
public String getOid ( ) { String ret = null ; if ( isValid ( ) ) { ret = getType ( ) . getId ( ) + "." + getId ( ) ; } return ret ; }
The string representation which is defined by this instance is returned .
9,899
public boolean checkEventId ( String conversationId , long conversationEventId , MissingEventsListener missingEventsListener ) { if ( ! idsPerConversation . containsKey ( conversationId ) ) { TreeSet < Long > ids = new TreeSet < > ( ) ; boolean added = ids . add ( conversationEventId ) ; idsPerConversation . put ( conv...
Check conversation event id for duplicates or missing events .