/** * Retrieves an Fqn that represents the array of elements passed in. * * @param elements array of elements that comprise the Fqn * @return an Fqn * @since 2.2.0 */ public static <T> Fqn<T> fromElements(T... elements) { return new Fqn<T>(elements, true); }
/** * Retrieves an Fqn that represents the absolute Fqn of the relative Fqn passed in. * * @param base base Fqn * @param relative relative Fqn * @return an Fqn * @since 2.2.0 */ @SuppressWarnings("unchecked") public static <T> Fqn<T> fromRelativeFqn(Fqn<? extends T> base, Fqn<? extends T> relative) { return new Fqn<T>(base, (T[]) relative.elements); }
private Fqn getAttributeFqn(String id) { // /SESSION/hostName/webAppPath/id/ATTR Object[] objs = new Object[]{SESSION, hostName_, webAppPath_, id, ATTRIBUTE}; return new Fqn(objs); }
private Fqn getSipappFqn() { // /SIPSESSION/hostname/sipApplicationName Object[] objs = new Object[]{SIPSESSION, hostName_, sipApplicationNameHashed}; return new Fqn(objs); }
private Fqn getSessionFqn(String id) { // /SESSION/hostname/webAppPath/id Object[] objs = new Object[]{SESSION, hostName_, webAppPath_, id}; return new Fqn(objs); }
private Fqn getSipSessionFqn(String id, String sessionId) { // /SIPSESSION/hostname/sipApplicationName/id/sessionId Object[] objs = new Object[]{SIPSESSION, hostName_, sipApplicationNameHashed, id, sessionId}; return new Fqn(objs); }
private Fqn getSessionFqn(String id, String dataOwner) { // /_BUDDY_BACKUP_/dataOwner/SESSION/hostname/webAppPath/id Object[] objs = new Object[]{BUDDY_BACKUP, dataOwner, SESSION, hostName_, webAppPath_, id}; return new Fqn(objs); }
/** * Retrieves an Fqn that represents the array of elements passed in, relative to the base Fqn. * * @param base base Fqn * @param relativeElements relative elements * @return an Fqn * @since 2.2.0 */ public static <T> Fqn<T> fromRelativeElements(Fqn<? extends T> base, T... relativeElements) { return new Fqn<T>(base, relativeElements); }
private Fqn getSipApplicationSessionFqn(String id, String dataOwner) { // /_BUDDY_BACKUP_/dataOwner/SIPSESSION/hostname/sipApplicationName/id Object[] objs = new Object[]{BUDDY_BACKUP, dataOwner, SIPSESSION, hostName_, sipApplicationNameHashed, id}; return new Fqn(objs); }
/** * Retrieves an Fqn that represents the list of elements passed in. * * @param names list of elements that comprise the Fqn * @return an Fqn * @since 2.2.0 */ @SuppressWarnings("unchecked") public static <T> Fqn<T> fromList(List<? extends T> names) { return new Fqn<T>(names.toArray(), true); }
/** * Retrieves an Fqn that represents the List<Object> of elements passed in, relative to the base Fqn. * * @param base base Fqn * @param relativeElements relative List<Object> of elements * @return an Fqn * @since 2.2.0 */ @SuppressWarnings("unchecked") public static <T> Fqn<T> fromRelativeList(Fqn<? extends T> base, List<? extends T> relativeElements) { return new Fqn<T>(base, (T[]) relativeElements.toArray()); }
public Object get(Object key) throws CacheException { try { Option option = new Option(); option.setFailSilently( true ); // option.setDataVersion( NonLockingDataVersion.INSTANCE ); return cache.get( new Fqn( regionFqn, key ), ITEM, option ); } catch (Exception e) { throw new CacheException(e); } }
public long getElementCountInMemory() { try { return cache.getChildrenNames( new Fqn(regionName) ).size(); } catch (Exception e) { throw new CacheException(e); } }
public void clear() throws CacheException { try { cache.remove( new Fqn(regionName) ); } catch (Exception e) { throw new CacheException(e); } }
public Object read(Object key) throws CacheException { try { return cache.get( new Fqn( regionFqn, key ), ITEM ); } catch (Exception e) { throw new CacheException(e); } }
public void update(Object key, Object value) throws CacheException { try { Option option = new Option(); option.setDataVersion( NonLockingDataVersion.INSTANCE ); cache.put( new Fqn( regionFqn, key ), ITEM, value, option ); } catch (Exception e) { throw new CacheException(e); } }
public Object read(Object key) throws CacheException { try { return cache.get( new Fqn( regionFqn, key ), ITEM ); } catch (Exception e) { throw new CacheException(e); } }
public void update(Object key, Object value) throws CacheException { try { cache.put( new Fqn( new Object[] { regionName, key } ), ITEM, value ); } catch (Exception e) { throw new CacheException(e); } }
public void update(Object key, Object value) throws CacheException { try { cache.put( new Fqn( regionFqn, key ), ITEM, value ); } catch (Exception e) { throw new CacheException(e); } }
public Object read(Object key) throws CacheException { try { return cache.get( new Fqn( new Object[] { regionName, key } ), ITEM ); } catch (Exception e) { throw new CacheException(e); } }