idx
int64
0
165k
question
stringlengths
73
5.81k
target
stringlengths
5
918
10,100
private void getGeneralID ( final String _complStmt ) throws EFapsException { ConnectionResource con = null ; try { con = Context . getThreadContext ( ) . getConnectionResource ( ) ; final Statement stmt = con . createStatement ( ) ; final ResultSet rs = stmt . executeQuery ( _complStmt . toString ( ) ) ; while ( rs . ...
Get the generalID etc . from the eFasp DataBase .
10,101
protected Compress getCompress ( ) { final Compress compress ; if ( this . store . getResourceProperties ( ) . containsKey ( Store . PROPERTY_COMPRESS ) ) { compress = Compress . valueOf ( this . store . getResourceProperties ( ) . get ( Store . PROPERTY_COMPRESS ) . toUpperCase ( ) ) ; } else { compress = Compress . N...
Is this Store resource compressed .
10,102
public static void registerUpdate ( final Instance _instance ) throws EFapsException { if ( EFapsSystemConfiguration . get ( ) != null && EFapsSystemConfiguration . get ( ) . getAttributeValueAsBoolean ( KernelSettings . INDEXACTIVATE ) ) { if ( _instance != null && _instance . getType ( ) != null && IndexDefinition . ...
Register update .
10,103
public static void initialize ( ) throws CacheReloadException { Context . getDbType ( ) . initialize ( AbstractDataModelObject . class ) ; AttributeType . initialize ( AbstractDataModelObject . class ) ; SQLTable . initialize ( AbstractDataModelObject . class ) ; Type . initialize ( AbstractDataModelObject . class ) ; ...
Initialize the cache of all data model objects .
10,104
public static String nullifyBadInput ( String input ) { if ( input != null ) { if ( input . matches ( emptyRegex ) ) { return null ; } return input . trim ( ) ; } return null ; }
Returns a valid string or null if empty
10,105
public static String [ ] nullifyBadInput ( String [ ] input ) { if ( input != null ) { if ( input . length > 0 ) { return input ; } } return null ; }
Returns a valid string array or null if empty
10,106
public static String [ ] removeDuplicates ( String [ ] input ) { if ( input != null ) { if ( input . length > 0 ) { Set < String > inputSet = new HashSet < String > ( Arrays . asList ( input ) ) ; if ( inputSet . size ( ) > 0 ) { return inputSet . toArray ( new String [ inputSet . size ( ) ] ) ; } } } return null ; }
Returns a valid string array without dulicates or null if empty
10,107
public String getString ( final String _key ) { String ret = null ; if ( this . attributes . containsKey ( _key ) ) { ret = this . attributes . get ( _key ) . getValue ( ) ; } return ret ; }
Returns the value for a key as a String .
10,108
public void set ( final String _key , final String _value , final UserAttributesDefinition _definition ) throws EFapsException { if ( _key == null || _value == null ) { throw new EFapsException ( this . getClass ( ) , "set" , _key , _value , _definition ) ; } else { final UserAttribute userattribute = this . attributes...
Sets a key - value pair into the attribute set of an user . The method will search for the key and if the key already exists it will update the user attribute in this set . If the key does not exist a new user attribute will be added to this set .
10,109
public Object get ( final Attribute _attribute , final Object _object ) throws EFapsException { Object ret = null ; if ( _object != null && _attribute . getAttributeType ( ) . getDbAttrType ( ) instanceof IFormattableType ) { final IFormattableType attrType = ( IFormattableType ) _attribute . getAttributeType ( ) . get...
Method to format a given object .
10,110
public static CachedMultiPrintQuery get4Request ( final List < Instance > _instances ) throws EFapsException { return new CachedMultiPrintQuery ( _instances , Context . getThreadContext ( ) . getRequestId ( ) ) . setLifespan ( 5 ) . setLifespanUnit ( TimeUnit . MINUTES ) ; }
Get a CachedMultiPrintQuery that will only cache during a request .
10,111
public Insert set ( final CIAttribute _attr , final Object _value ) throws EFapsException { return super . set ( _attr . name , Converter . convert ( _value ) ) ; }
Sets a value for an CIAttribute .
10,112
public void set ( double x , double y , double z ) { this . MODE = POINTS_3D ; this . x = x ; this . y = y ; this . z = z ; }
Sets x y z - coordinate .
10,113
protected void addType ( final Long _typeId ) { if ( ! this . types . contains ( _typeId ) ) { this . types . add ( _typeId ) ; setDirty ( ) ; } }
The instance method adds a new type to the type list .
10,114
private void loadResourceProperties ( final long _id ) throws EFapsException { this . resourceProperties . clear ( ) ; final QueryBuilder queryBldr = new QueryBuilder ( CIAdminCommon . Property ) ; queryBldr . addWhereAttrEqValue ( CIAdminCommon . Property . Abstract , _id ) ; final MultiPrintQuery multi = queryBldr . ...
Method to get the properties for the resource .
10,115
public Resource getResource ( final Instance _instance ) throws EFapsException { Resource ret = null ; try { Store . LOG . debug ( "Getting resource for: {} with properties: {}" , this . resource , this . resourceProperties ) ; ret = ( Resource ) Class . forName ( this . resource ) . newInstance ( ) ; ret . initialize ...
Method to get a instance of the resource .
10,116
public BufferedImage copyImage ( BufferedImage image ) { BufferedImage newImage = new BufferedImage ( image . getWidth ( ) , image . getHeight ( ) , image . getType ( ) ) ; Graphics2D g2d = newImage . createGraphics ( ) ; g2d . drawImage ( image , 0 , 0 , null ) ; g2d . dispose ( ) ; return newImage ; }
Copies a Image object using BuffedImage .
10,117
public final void loadTexture ( ) { texture = null ; texture = AWTTextureIO . newTexture ( GLProfile . get ( GLProfile . GL2 ) , img , true ) ; if ( texture == null ) { throw new CasmiRuntimeException ( "Cannot load texture" ) ; } }
Loads a texture using image data .
10,118
public final Color getColor ( int x , int y ) { int [ ] pixels = ( ( DataBufferInt ) img . getRaster ( ) . getDataBuffer ( ) ) . getData ( ) ; int idx = x + y * width ; return new RGBColor ( ( pixels [ idx ] >> 16 & 0x000000ff ) / 255.0 , ( pixels [ idx ] >> 8 & 0x000000ff ) / 255.0 , ( pixels [ idx ] & 0x000000ff ) / ...
Returns the pixel color of this Image .
10,119
public final double getRed ( int x , int y ) { int [ ] pixels = ( ( DataBufferInt ) img . getRaster ( ) . getDataBuffer ( ) ) . getData ( ) ; int idx = x + y * width ; return ( pixels [ idx ] >> 16 & 0x000000ff ) ; }
Returns the red color value of the pixel data in this Image .
10,120
public final void setColor ( Color color , int x , int y ) { int [ ] pixels = ( ( DataBufferInt ) img . getRaster ( ) . getDataBuffer ( ) ) . getData ( ) ; int red = ( int ) ( color . getRed ( ) * 255.0 ) ; int green = ( int ) ( color . getGreen ( ) * 255.0 ) ; int blue = ( int ) ( color . getBlue ( ) * 255.0 ) ; int a...
Sets the color value of the pixel data in this Image .
10,121
public final void setA ( double alpha , int x , int y ) { int [ ] pixels = ( ( DataBufferInt ) img . getRaster ( ) . getDataBuffer ( ) ) . getData ( ) ; int idx = x + y * width ; int tmpR = pixels [ idx ] >> 16 & 0x000000ff ; int tmpG = pixels [ idx ] >> 8 & 0x000000ff ; int tmpB = pixels [ idx ] & 0x000000ff ; pixels ...
Sets the alpha value of the pixel data in this Image .
10,122
public final void setColors ( Color [ ] colors ) { int [ ] pixels = ( ( DataBufferInt ) img . getRaster ( ) . getDataBuffer ( ) ) . getData ( ) ; for ( int y = 0 ; y < height ; ++ y ) { for ( int x = 0 ; x < width ; ++ x ) { int idx = x + y * width ; if ( colors . length <= idx ) break ; int red = ( int ) ( colors [ id...
Sets the color values to this Image .
10,123
public static AbstractCI < ? > getCI ( final ICIPrintStmt _stmt ) throws CacheReloadException { AbstractCI < ? > ret = null ; switch ( _stmt . getCINature ( ) ) { case TYPE : final Type type ; if ( UUIDUtil . isUUID ( _stmt . getCI ( ) ) ) { type = Type . get ( UUID . fromString ( _stmt . getCI ( ) ) ) ; } else { type ...
Gets the ci .
10,124
public void addUniqueKeyColumn ( final String _ukName , final int _colIndex , final String _colName ) { final String ukName = _ukName . toUpperCase ( ) ; final UniqueKeyInformation uki ; if ( ! this . ukMap . containsKey ( ukName ) ) { uki = new UniqueKeyInformation ( _ukName ) ; this . ukMap . put ( ukName , uki ) ; }...
Adds an unique key information to this table information .
10,125
public void addForeignKey ( final String _fkName , final String _colName , final String _refTableName , final String _refColName , final boolean _cascade ) { this . fkMap . put ( _fkName . toUpperCase ( ) , new ForeignKeyInformation ( _fkName , _colName , _refTableName , _refColName , _cascade ) ) ; }
Fetches all foreign keys for this table .
10,126
@ SuppressWarnings ( "unchecked" ) private List < ListenerRegistration > addListenerToRegistry ( ) { List < ListenerRegistration > registrationsBuilder = newArrayList ( ) ; for ( Pair < IdMatcher , Watcher > guiceWatcherRegistration : getRegisteredWatchers ( ) ) { Watcher watcher = guiceWatcherRegistration . right ( ) ...
enforce creation of all watcher before register it
10,127
private void initConfig ( ) { SystemConfiguration config = null ; try { config = EFapsSystemConfiguration . get ( ) ; if ( config != null ) { final Properties confProps = config . getAttributeValueAsProperties ( KernelSettings . PWDSTORE ) ; this . digesterConfig . setAlgorithm ( confProps . getProperty ( PasswordStore...
Initialize the digester configuration by reading values from the kernel SystemConfiguration .
10,128
public void read ( final String _readValue ) throws EFapsException { if ( _readValue != null ) { try { this . props . load ( new StringReader ( _readValue ) ) ; } catch ( final IOException e ) { throw new EFapsException ( PasswordStore . class . getName ( ) , e ) ; } } }
Read a PasswordStore from a String .
10,129
private boolean check ( final String _plainPassword , final int _pos ) { boolean ret = false ; if ( this . props . containsKey ( PasswordStore . DIGEST + _pos ) ) { final ConfigurablePasswordEncryptor passwordEncryptor = new ConfigurablePasswordEncryptor ( ) ; this . digesterConfig . setAlgorithm ( this . props . getPr...
Check the given Plain Text Password for equal on the Hash by applying the algorithm salt etc .
10,130
public boolean isRepeated ( final String _plainPassword ) { boolean ret = false ; for ( int i = 1 ; i < this . threshold + 1 ; i ++ ) { ret = check ( _plainPassword , i ) ; if ( ret ) { break ; } } return ret ; }
Is the given plain password repeated . It is checked against the existing previous passwords .
10,131
public void setNew ( final String _plainPassword , final String _currentValue ) throws EFapsException { initConfig ( ) ; read ( _currentValue ) ; final ConfigurablePasswordEncryptor passwordEncryptor = new ConfigurablePasswordEncryptor ( ) ; passwordEncryptor . setConfig ( this . digesterConfig ) ; final String encrypt...
Set the given given Plain Password as the new current Password by encrypting it .
10,132
private void shiftAll ( ) { shift ( PasswordStore . DIGEST ) ; shift ( PasswordStore . ALGORITHM ) ; shift ( PasswordStore . ITERATIONS ) ; shift ( PasswordStore . SALTSIZE ) ; }
Shift all Properties .
10,133
private void shift ( final String _key ) { for ( int i = this . threshold ; i > 0 ; i -- ) { this . props . setProperty ( _key + i , this . props . getProperty ( _key + ( i - 1 ) , "" ) . trim ( ) ) ; } int i = this . threshold + 1 ; while ( this . props . contains ( _key + i ) ) { this . props . remove ( _key + i ) ; ...
Shift a property .
10,134
public Long createBatch ( String batchTaskName , String data , String key1 , String key2 , List < TedTask > tedTasks ) { if ( tedTasks == null || tedTasks . isEmpty ( ) ) return null ; if ( batchTaskName == null ) { throw new IllegalStateException ( "batchTaskName is required!" ) ; } TaskConfig batchTC = context . regi...
if batchTaskName is null - will take from taskConfiguration
10,135
public int maxDepth ( ) { Map < DFAState < T > , Integer > indexOf = new NumMap < > ( ) ; Map < DFAState < T > , Long > depth = new NumMap < > ( ) ; Deque < DFAState < T > > stack = new ArrayDeque < > ( ) ; maxDepth ( root , indexOf , stack , depth ) ; long d = depth . get ( root ) ; assert d >= 0 ; if ( d >= Integer ....
Calculates the maximum length of accepted string . Returns Integer . MAX_VALUE if length is infinite . For if|while returns 5 . For a + returns Integer . MAX_VALUE .
10,136
public void calculateMaxFindSkip ( ) { Map < DFAState < T > , Integer > indexOf = new NumMap < > ( ) ; Map < DFAState < T > , Integer > skip = new NumMap < > ( ) ; Deque < DFAState < T > > stack = new ArrayDeque < > ( ) ; findSkip ( root , indexOf , stack , new LinkedList ( ) ) ; root . setAcceptStartLength ( 1 ) ; }
Calculates how many characters we can skip after failed find operation
10,137
public void register ( ) { logger . debug ( "[register] uri = {}" , getManagementUri ( ) ) ; JsonNode jsonNode ; ObjectMapper objectMapper = jsonObjectMapper . getObjectMapperBinary ( ) ; ObjectNode objectNode = objectMapper . createObjectNode ( ) ; objectNode . put ( CommandParameters . METHOD , "register" ) ; try { j...
Registers with the Neo4j server and saves some Neo4j server information with this object .
10,138
public DataConnection getConnection ( ) { DataConnection connection ; for ( connection = availableConnections . poll ( ) ; connection != null && ! connection . isUsable ( ) ; connection = availableConnections . poll ( ) ) { if ( ! connection . isUsable ( ) ) { connection . close ( ) ; } } if ( connection == null ) { co...
Gets a connection from the pool of available and free data connections to this server .
10,139
public void returnConnection ( DataConnection connection ) { if ( connection . isUsable ( ) ) { connection . setLastUsage ( new Date ( ) ) ; availableConnections . add ( connection ) ; } else { connection . close ( ) ; } usedConnections . remove ( connection ) ; }
Returns a connection to the pool of available and free data connections to this server .
10,140
public void connect ( ) throws Exception { logger . debug ( "[connect] initializing new connection" ) ; if ( timer != null ) { timer . cancel ( ) ; } if ( isConnected ( ) ) { return ; } synchronized ( webSocketHandler . getNotifyConnectionObject ( ) ) { webSocketConnectionManager . start ( ) ; try { webSocketHandler . ...
Connects to the Neo4j server identified by URI and ID of this connection .
10,141
public void onConnectionClosed ( ) { logger . debug ( "[onConnectionClosed] '{}', isConnected = {}" , uri , isConnected ( ) ) ; webSocketConnectionManager . stop ( ) ; timer = new Timer ( ) ; timer . schedule ( new TimerTask ( ) { public void run ( ) { logger . debug ( "[onConnectionClosed:run]" ) ; synchronized ( webS...
Is being called when the websocket connection was closed and tries to reconnect .
10,142
public byte [ ] sendWithResult ( final byte [ ] message ) { synchronized ( webSocketHandler . getNotifyResultObject ( ) ) { webSocketHandler . sendMessage ( message ) ; try { webSocketHandler . getNotifyResultObject ( ) . wait ( TimeUnit . SECONDS . toMillis ( ANSWER_TIMEOUT ) ) ; } catch ( InterruptedException e ) { r...
Sends a message through it s websocket connection to the server and waits for the reply .
10,143
public Object getObject ( ) { Object ret = null ; try { ret = this . proxy . getValue ( this . object ) ; } catch ( final EFapsException e ) { LOG . error ( "Catched" , e ) ; } return ret ; }
Gets the object .
10,144
public void setCenterColor ( Color color ) { if ( centerColor == null ) { centerColor = new RGBColor ( 0.0 , 0.0 , 0.0 ) ; } setGradation ( true ) ; this . centerColor = color ; }
Sets the color of this Ellipse s center .
10,145
protected Attribute copy ( final long _parentId ) { final Attribute ret = new Attribute ( getId ( ) , _parentId , getName ( ) , this . sqlTable , this . attributeType , this . defaultValue , this . dimensionUUID , this . required , this . size , this . scale ) ; ret . getSqlColNames ( ) . addAll ( getSqlColNames ( ) ) ...
The method makes a clone of the current attribute instance .
10,146
public Dimension getDimension ( ) { Dimension ret = null ; try { ret = Dimension . get ( UUID . fromString ( this . dimensionUUID ) ) ; } catch ( final CacheReloadException e ) { Attribute . LOG . error ( "Catched CacheReloadException" , e ) ; } return ret ; }
Method to get the dimension related to this attribute .
10,147
public static void initialize ( final Class < ? > _class ) throws CacheReloadException { if ( InfinispanCache . get ( ) . exists ( Attribute . NAMECACHE ) ) { InfinispanCache . get ( ) . < String , Attribute > getCache ( Attribute . NAMECACHE ) . clear ( ) ; } else { InfinispanCache . get ( ) . < String , Attribute > g...
Method to initialize this Cache .
10,148
public String toHtml ( ) { StringBuilder stringBuilder = new StringBuilder ( ) ; stringBuilder . append ( "<p>" ) . append ( objectNode . get ( TYPE ) . asText ( ) ) . append ( ": " ) . append ( objectNode . get ( MESSAGE ) . asText ( ) ) . append ( " -> " ) . append ( objectNode . get ( DETAILS ) . toString ( ) ) . ap...
Get the error as a string in html format
10,149
LifecycleListener createLifecycleListener ( final WeakReference < ComapiChatClient > ref ) { return new LifecycleListener ( ) { public void onForegrounded ( Context context ) { ComapiChatClient client = ref . get ( ) ; if ( client != null ) { client . service ( ) . messaging ( ) . synchroniseStore ( null ) ; } } public...
Creates listener for Application visibility .
10,150
public void addListener ( final ParticipantsListener participantsListener ) { if ( participantsListener != null ) { MessagingListener messagingListener = new MessagingListener ( ) { public void onParticipantAdded ( ParticipantAddedEvent event ) { participantsListener . onParticipantAdded ( event ) ; } public void onPar...
Registers listener for changes in participant list in conversations . Delivers participant added updated and removed events .
10,151
public void removeListener ( final ParticipantsListener participantsListener ) { MessagingListener messagingListener = participantsListeners . get ( participantsListener ) ; if ( messagingListener != null ) { client . removeListener ( messagingListener ) ; participantsListeners . remove ( participantsListener ) ; } }
Removes listener for changes in participant list in conversations .
10,152
public void addListener ( final ProfileListener profileListener ) { if ( profileListener != null ) { com . comapi . ProfileListener foundationListener = new com . comapi . ProfileListener ( ) { public void onProfileUpdate ( ProfileUpdateEvent event ) { profileListener . onProfileUpdate ( event ) ; } } ; profileListener...
Registers listener for changes in profile details .
10,153
public void removeListener ( final ProfileListener profileListener ) { com . comapi . ProfileListener foundationListener = profileListeners . get ( profileListener ) ; if ( foundationListener != null ) { client . removeListener ( foundationListener ) ; profileListeners . remove ( profileListener ) ; } }
Removes listener for changes in profile details .
10,154
public static void initialize ( ) throws CacheReloadException { if ( InfinispanCache . get ( ) . exists ( JAASSystem . IDCACHE ) ) { InfinispanCache . get ( ) . < Long , JAASSystem > getCache ( JAASSystem . IDCACHE ) . clear ( ) ; } else { InfinispanCache . get ( ) . < Long , JAASSystem > getCache ( JAASSystem . IDCACH...
Method to initialize the cache of JAAS systems .
10,155
public static Set < JAASSystem > getAllJAASSystems ( ) { final Set < JAASSystem > ret = new HashSet < > ( ) ; final Cache < Long , JAASSystem > cache = InfinispanCache . get ( ) . < Long , JAASSystem > getCache ( JAASSystem . IDCACHE ) ; for ( final Map . Entry < Long , JAASSystem > entry : cache . entrySet ( ) ) { ret...
Returns all cached JAAS system in a set .
10,156
void reset ( boolean deleteFile ) { String path = this . path ; this . path = null ; this . projectId = - 1 ; this . projectToken = null ; this . deviceId = null ; this . client = null ; synchronized ( dataStoreLock ) { dataStore = null ; dataBatches . clear ( ) ; } if ( deleteFile ) { File f = new File ( path , DEVICE...
Resets the iobeam client to uninitialized state including removing any added data .
10,157
public void registerDeviceAsync ( String deviceId , RegisterCallback callback ) { final Device d = new Device . Builder ( projectId ) . id ( deviceId ) . build ( ) ; registerDeviceAsync ( d , callback ) ; }
Registers a device asynchronously with the provided device ID .
10,158
public void registerDeviceWithIdAsync ( String deviceId , String deviceName , RegisterCallback callback ) { final Device d = new Device . Builder ( projectId ) . id ( deviceId ) . name ( deviceName ) . build ( ) ; registerDeviceAsync ( d , callback ) ; }
Registers a device asynchronously with the provided device ID and name .
10,159
public void setDeviceId ( String deviceId ) throws CouldNotPersistException { this . deviceId = deviceId ; if ( deviceId != null && path != null ) { persistDeviceId ( ) ; } }
Sets the current device id that the iobeam client is associated with .
10,160
public DataStore getDataStore ( final Collection < String > columns ) { for ( DataStore ds : dataBatches ) { if ( ds . hasColumns ( columns ) ) { return ds ; } } return null ; }
Get the DataStore associated with a collection of column names .
10,161
public DataStore getOrAddDataStore ( final Collection < String > columns ) { DataStore ret = getDataStore ( columns ) ; if ( ret == null ) { ret = this . createDataStore ( columns ) ; } return ret ; }
Get the DataStore associated with a collection of column names adding a new one if necessary .
10,162
public void addData ( String seriesName , DataPoint dataPoint ) { synchronized ( dataStoreLock ) { _addDataWithoutLock ( seriesName , dataPoint ) ; } }
Adds a data value to a particular series in the data store .
10,163
public boolean addDataMapToSeries ( String [ ] seriesNames , DataPoint [ ] points ) { if ( seriesNames == null || points == null || points . length != seriesNames . length ) { return false ; } synchronized ( dataStoreLock ) { for ( int i = 0 ; i < seriesNames . length ; i ++ ) { _addDataWithoutLock ( seriesNames [ i ] ...
Adds a list of data points to a list of series in the data store . This is essentially a zip operation on the points and series names where the first point is put in the first series the second point in the second series etc . Both lists MUST be the same size .
10,164
public DataStore createDataStore ( Collection < String > columns ) { DataStore b = new DataStore ( columns ) ; trackDataStore ( b ) ; return b ; }
Creates a DataStore with a given set of columns and tracks it so that any data added will be sent on a subsequent send calls .
10,165
public long getDataSize ( ) { long size = 0 ; synchronized ( dataStoreLock ) { for ( DataStore b : dataBatches ) { size += b . getDataSize ( ) ; } } return size ; }
Returns the size of all of the data in all the series .
10,166
private int getSeriesSize ( String series ) { synchronized ( dataStoreLock ) { if ( dataStore == null ) { return 0 ; } if ( seriesToBatch . containsKey ( series ) ) { return ( int ) seriesToBatch . get ( series ) . getDataSize ( ) ; } else { return 0 ; } } }
Returns the size of the data set in a particular series .
10,167
public void reload ( ) { InfinispanCache . get ( ) . < UUID , SystemConfiguration > getCache ( SystemConfiguration . UUIDCACHE ) . remove ( uuid ) ; InfinispanCache . get ( ) . < Long , SystemConfiguration > getCache ( SystemConfiguration . IDCACHE ) . remove ( id ) ; InfinispanCache . get ( ) . < String , SystemConfig...
Reload the current SystemConfiguration by removing it from the Cache .
10,168
private void readConfig ( ) throws CacheReloadException { Connection con = null ; try { boolean closeContext = false ; if ( ! Context . isThreadActive ( ) ) { Context . begin ( ) ; closeContext = true ; } final List < Object [ ] > dbValues = new ArrayList < > ( ) ; con = Context . getConnection ( ) ; PreparedStatement ...
Read the config .
10,169
@ Consumes ( MediaType . APPLICATION_JSON ) public Response put ( @ PathParam ( "cacheName" ) String cacheName , Cache cache ) { if ( ! cacheService . isPresent ( cacheName ) ) { return Response . status ( Response . Status . NOT_FOUND ) . build ( ) ; } cacheService . update ( cacheName , cache ) ; return Response . ok...
Modify state of a single cache
10,170
protected void addAttributes ( final boolean _inherited , final Attribute ... _attributes ) throws CacheReloadException { for ( final Attribute attribute : _attributes ) { if ( ! this . attributes . containsKey ( attribute . getName ( ) ) ) { Type . LOG . trace ( "adding Attribute:'{}' to type: '{}'" , attribute . getN...
Add attributes to this type and all child types of this type . Recursive method .
10,171
protected void inheritAttributes ( ) throws CacheReloadException { Type parent = getParentType ( ) ; final List < Attribute > attributesTmp = new ArrayList < > ( ) ; while ( parent != null ) { for ( final Attribute attribute : getParentType ( ) . getAttributes ( ) . values ( ) ) { attributesTmp . add ( attribute . copy...
Inherit Attributes are child types .
10,172
public Attribute getTypeAttribute ( ) { final Attribute ret ; if ( this . typeAttributeName == null && getParentType ( ) != null ) { ret = getParentType ( ) . getTypeAttribute ( ) ; } else { ret = this . attributes . get ( this . typeAttributeName ) ; } return ret ; }
Get the attribute containing the type information .
10,173
@ SuppressWarnings ( "unchecked" ) public Map < Instance , Boolean > checkAccess ( final Collection < Instance > _instances , final AccessType _accessType ) throws EFapsException { Map < Instance , Boolean > ret = new HashMap < > ( ) ; if ( _instances != null && ! _instances . isEmpty ( ) && _instances . size ( ) == 1 ...
Method to check the access right for a list of instances .
10,174
protected void addClassifiedByType ( final Classification _classification ) { this . checked4classifiedBy = true ; this . classifiedByTypes . add ( _classification . getId ( ) ) ; setDirty ( ) ; }
Add a root Classification to this type .
10,175
protected static void cacheTypesByHierachy ( final Type _type ) throws CacheReloadException { final Cache < UUID , Type > cache4UUID = InfinispanCache . get ( ) . < UUID , Type > getIgnReCache ( Type . UUIDCACHE ) ; if ( cache4UUID . getCacheConfiguration ( ) . clustering ( ) != null && ! cache4UUID . getCacheConfigura...
In case of a cluster the types must be cached after the final loading again to be sure that the last instance including all the changes like attribute links etc are up to date .
10,176
private void recacheChildren ( ) throws CacheReloadException { if ( isDirty ( ) ) { Type . cacheType ( this ) ; } for ( final Type child : getChildTypes ( ) ) { child . recacheChildren ( ) ; } }
Recache the children in dropdown . Used for Caching in cluster .
10,177
public void transpose ( ) { double temp ; temp = m01 ; m01 = m10 ; m10 = temp ; temp = m02 ; m02 = m20 ; m20 = temp ; temp = m03 ; m03 = m30 ; m30 = temp ; temp = m12 ; m12 = m21 ; m21 = temp ; temp = m13 ; m13 = m31 ; m31 = temp ; temp = m23 ; m23 = m32 ; m32 = temp ; }
Transpose this matrix .
10,178
private double determinant3x3 ( double t00 , double t01 , double t02 , double t10 , double t11 , double t12 , double t20 , double t21 , double t22 ) { return ( t00 * ( t11 * t22 - t12 * t21 ) + t01 * ( t12 * t20 - t10 * t22 ) + t02 * ( t10 * t21 - t11 * t20 ) ) ; }
Calculate the determinant of a 3x3 matrix .
10,179
ThreadPoolExecutor createChannelExecutor ( String channel , final String threadPrefix , final int workerCount , int queueSize ) { ThreadFactory threadFactory = new ThreadFactory ( ) { private int counter = 0 ; public Thread newThread ( Runnable runnable ) { return new Thread ( runnable , threadPrefix + "-" + ++ counter...
create ThreadPoolExecutor for channel
10,180
ThreadPoolExecutor createExecutor ( final String threadPrefix , final int workerCount , int queueSize ) { ThreadFactory threadFactory = new ThreadFactory ( ) { private int counter = 0 ; public Thread newThread ( Runnable runnable ) { return new Thread ( runnable , threadPrefix + "-" + ++ counter ) ; } } ; ThreadPoolExe...
create general purpose ThreadPoolExecutor
10,181
ScheduledExecutorService createSchedulerExecutor ( final String prefix ) { ThreadFactory threadFactory = new ThreadFactory ( ) { private int counter = 0 ; public Thread newThread ( Runnable runnable ) { return new Thread ( runnable , prefix + ++ counter ) ; } } ; ScheduledExecutorService executor = java . util . concur...
create scheduler ThreadPoolExecutor
10,182
protected void open ( ) throws EFapsException { AbstractResource . LOG . debug ( "open resource:{}" , this ) ; if ( this . opened ) { AbstractResource . LOG . error ( "resource already opened" ) ; throw new EFapsException ( AbstractResource . class , "open.AlreadyOpened" ) ; } try { final Context context = Context . ge...
Opens this connection resource and enlisted this resource in the transaction .
10,183
public void end ( final Xid _xid , final int _flags ) { AbstractResource . LOG . trace ( "end resource {}, flags {}" + _flags , _xid , _flags ) ; }
The method ends the work performed on behalf of a transaction branch . Normally nothing must be done because an instance of a resource is only defined for one transaction .
10,184
private List < UpdateLifecycle > getUpdateLifecycles ( ) { final List < UpdateLifecycle > ret = new ArrayList < > ( ) ; for ( final UpdateLifecycle cycle : UpdateLifecycle . values ( ) ) { ret . add ( cycle ) ; } Collections . sort ( ret , ( _cycle1 , _cycle2 ) -> _cycle1 . getOrder ( ) . compareTo ( _cycle2 . getOrder...
Method to get all UpdateLifecycle in an ordered List .
10,185
protected void initialise ( ) throws InstallationException { if ( ! this . initialised ) { this . initialised = true ; this . cache . clear ( ) ; AppDependency . initialise ( ) ; for ( final FileType fileType : FileType . values ( ) ) { if ( fileType == FileType . XML ) { for ( final InstallFile file : this . files ) {...
Reads all XML update files and parses them .
10,186
public void set ( boolean index , double x , double y ) { this . MODE = LINES ; if ( index == true ) { this . x1 = x ; this . y1 = y ; } else { this . x2 = x ; this . y2 = y ; } calcG ( ) ; dx [ 0 ] = x1 - this . x ; dx [ 1 ] = x2 - this . x ; dy [ 0 ] = y1 - this . y ; dy [ 1 ] = y2 - this . y ; dz [ 0 ] = z1 - 0 ; dz...
Sets the coordinates for the first or second point .
10,187
public void setDashedLinePram ( double length , double interval ) { this . dashedLineLength = length ; this . dashedLineInterval = interval ; this . dashed = true ; calcDashedLine ( ) ; }
Sets the parameter for the dashed line .
10,188
public Vector3D getCorner ( int index ) { Vector3D v = new Vector3D ( ) ; if ( index <= 0 ) v . set ( x1 , y1 , z1 ) ; else v . set ( x2 , y2 , z2 ) ; return v ; }
Gets coordinates of the point .
10,189
public String getValueList ( ) { final StringBuffer buf = new StringBuffer ( ) ; for ( final Token token : this . tokens ) { switch ( token . type ) { case EXPRESSION : buf . append ( "$<" ) . append ( token . value ) . append ( ">" ) ; break ; case TEXT : buf . append ( token . value ) ; break ; default : break ; } } ...
Get the ValueList .
10,190
public void addExpression ( final String _expression ) { this . tokens . add ( new Token ( ValueList . TokenType . EXPRESSION , _expression ) ) ; getExpressions ( ) . add ( _expression ) ; }
Add an Expression to this ValueList .
10,191
public void addText ( final String _text ) { this . tokens . add ( new Token ( ValueList . TokenType . TEXT , _text ) ) ; }
Add Text to the Tokens .
10,192
public void makeSelect ( final AbstractPrintQuery _print ) throws EFapsException { for ( final String expression : getExpressions ( ) ) { if ( _print . getMainType ( ) . getAttributes ( ) . containsKey ( expression ) ) { _print . addAttribute ( expression ) ; ValueList . LOG . warn ( "The arguments for ValueList must o...
This method adds the expressions of this ValueList to the given query .
10,193
public String makeString ( final Instance _callInstance , final AbstractPrintQuery _print , final TargetMode _mode ) throws EFapsException { final StringBuilder buf = new StringBuilder ( ) ; for ( final Token token : this . tokens ) { switch ( token . type ) { case EXPRESSION : Attribute attr = null ; Object value = nu...
This method retrieves the Values from the given PrintQuery and combines them with the Text partes .
10,194
public static void moveFile ( File src , File dest ) throws IOException { copyFile ( src , dest ) ; if ( ! delete ( src ) ) { throw new IOException ( "Failed to delete the src file '" + src + "' after copying." ) ; } }
Moves a file from src to dest . This method is equals to copy - > delete .
10,195
public static void copyFile ( File src , File dest ) throws IOException { if ( src == null ) throw new NullPointerException ( "Source must not be null" ) ; if ( dest == null ) throw new NullPointerException ( "Destination must not be null" ) ; if ( ! src . exists ( ) ) throw new FileNotFoundException ( "Source '" + src...
Copies a file to a new location preserving the file date .
10,196
public static boolean delete ( File file ) { if ( file == null ) { return false ; } else if ( ! file . isFile ( ) ) { return false ; } return file . delete ( ) ; }
Deletes a file .
10,197
public static boolean exist ( String filePath ) { File f = new File ( filePath ) ; if ( ! f . isFile ( ) ) { return false ; } return true ; }
Check file existence
10,198
public static String getSuffix ( File file ) { String filename = file . getName ( ) ; int index = filename . lastIndexOf ( "." ) ; if ( index != - 1 ) { return filename . substring ( index + 1 ) ; } return filename ; }
Returns a suffix string from a File .
10,199
public static String searchFilePath ( String fileName ) { java . io . File dir = new java . io . File ( System . getProperty ( "user.dir" ) ) ; return recursiveSearch ( dir , fileName ) ; }
Search an absolute file path from current working directory recursively .