private String getScopeStringRep() { try { return ScopeGenerator.generateStringRep(scope); } catch (CouldNotPerformException ex) { return "?"; } }
private String generateItemId(final UnitConfig appConfig) throws CouldNotPerformException { return StringProcessor.transformToIdString("App") + ITEM_SEGMENT_DELIMITER + ScopeGenerator.generateStringRepWithDelimiter(appConfig.getScope(), ITEM_SUBSEGMENT_DELIMITER); } }
@Override public void init(Scope scope) throws InitializationException, InterruptedException { try { init(ScopeTransformer.transform(scope)); } catch (CouldNotPerformException ex) { throw new InitializationException(this, ex); } }
public static ScopeType.Scope generateScope(final String scope) throws CouldNotPerformException { ScopeType.Scope.Builder generatedScope = ScopeType.Scope.newBuilder(); for (String component : scope.split("/")) { // check for empty components (/a//b/ = /a/b/) if (component.isEmpty()) { continue; } generatedScope.addComponent(convertIntoValidScopeComponent(component)); } return generatedScope.build(); }
/** * {@inheritDoc} * * @param scope * @throws org.openbase.jul.exception.InitializationException * @throws java.lang.InterruptedException */ @Override public void init(final String scope) throws InitializationException, InterruptedException { try { this.init(ScopeGenerator.generateScope(scope)); } catch (CouldNotPerformException ex) { throw new InitializationException(this, ex); } }
/** * Method prints a class instance representation. * * @return the class string representation. */ @Override public String toString() { try { return getClass().getSimpleName() + "[scope:" + ScopeGenerator.generateStringRep(scope) + "]"; } catch (CouldNotPerformException ex) { return getClass().getSimpleName() + "[scope:?]"; } }
private String generateItemId(final UnitConfig appConfig) throws CouldNotPerformException { return StringProcessor.transformToIdString("App") + ITEM_SEGMENT_DELIMITER + ScopeGenerator.generateStringRepWithDelimiter(appConfig.getScope(), ITEM_SUBSEGMENT_DELIMITER); } }
/** * @param scope * @param participantConfig * @throws InitializationException * @throws InterruptedException */ public void init(final rsb.Scope scope, final ParticipantConfig participantConfig) throws InitializationException, InterruptedException { try { init(ScopeTransformer.transform(scope), participantConfig); } catch (CouldNotTransformException ex) { throw new InitializationException(this, ex); } }
@Override protected Scope getPropertyDefaultValue() { if(JPService.testMode()) { String user = ScopeGenerator.convertIntoValidScopeComponent(System.getProperty("user.name")); return new Scope("/test/"+user); } return new Scope("/"); }
public static String generateStringRep(final Scope scope) throws CouldNotPerformException { try { if (scope == null) { throw new NotAvailableException("scope"); } return generateStringRep(scope.getComponents()); } catch (CouldNotPerformException ex) { throw new CouldNotPerformException("Could not generate scope string representation!", ex); } }
public static String generateUnitGroupID(final ScopeType.Scope scope) throws CouldNotPerformException { try { if (scope == null) { throw new NotAvailableException("locationconfig.scope"); } return ScopeGenerator.generateStringRepWithDelimiter(scope, OPENHAB_ID_DELIMITER); } catch (CouldNotPerformException ex) { throw new CouldNotPerformException("Could not generate group id out of Scope[" + scope + "]!", ex); } } }
/** * {@inheritDoc} * * @param scope * @throws org.openbase.jul.exception.InitializationException * @throws java.lang.InterruptedException */ @Override public void init(final Scope scope) throws InitializationException, InterruptedException { try { this.init(ScopeTransformer.transform(scope)); } catch (CouldNotPerformException ex) { throw new InitializationException(this, ex); } }
@Override public void init() throws InitializationException, InterruptedException { try { super.init(SCOPE_PREFIX_LAUNCHER + Scope.COMPONENT_SEPARATOR + ScopeGenerator.convertIntoValidScopeComponent(getName())); } catch (NotAvailableException ex) { throw new InitializationException(this, ex); } }
public static String generateStringRep(final ScopeType.Scope scope) throws CouldNotPerformException { try { if (scope == null) { throw new NotAvailableException("scope"); } return generateStringRep(scope.getComponentList()); } catch (CouldNotPerformException ex) { throw new CouldNotPerformException("Could not generate scope string representation!", ex); } }
private String generateItemId(final UnitConfig sceneUnitConfig) throws CouldNotPerformException { return StringProcessor.transformToIdString("Scene") + ITEM_SEGMENT_DELIMITER + ScopeGenerator.generateStringRepWithDelimiter(sceneUnitConfig.getScope(), ITEM_SUBSEGMENT_DELIMITER); } }
public static ScopeType.Scope generateScope(final String label, final String type, final ScopeType.Scope locationScope) throws CouldNotPerformException { try { ScopeType.Scope.Builder newScope = ScopeType.Scope.newBuilder(); newScope.addAllComponent(locationScope.getComponentList()); newScope.addComponent(convertIntoValidScopeComponent(type)); newScope.addComponent(convertIntoValidScopeComponent(label)); return newScope.build(); } catch (NullPointerException ex) { throw new CouldNotPerformException("Coult not generate scope!", ex); } }
@RPCMethod default public String getUnitScopeById(final String id) throws CouldNotPerformException { return ScopeGenerator.generateStringRep(getUnitConfigById(id).getScope()); }
private String generateItemId(final UnitConfig sceneUnitConfig) throws CouldNotPerformException { return StringProcessor.transformToIdString("Scene") + ITEM_SEGMENT_DELIMITER + ScopeGenerator.generateStringRepWithDelimiter(sceneUnitConfig.getScope(), ITEM_SUBSEGMENT_DELIMITER); } }
private String generateItemId(final UnitConfig agentConfig) throws CouldNotPerformException { return StringProcessor.transformToIdString("Agent") + ITEM_SEGMENT_DELIMITER + ScopeGenerator.generateStringRepWithDelimiter(agentConfig.getScope(), ITEM_SUBSEGMENT_DELIMITER); } }