public SqlFieldInfo getListFieldInfo(String name) throws UnifyException { SqlFieldInfo sqlFieldInfo = listFieldInfoByName.get(name); if (sqlFieldInfo == null) { throw new UnifyException(UnifyCoreErrorConstants.RECORD_LISTFIELDINFO_NOT_FOUND, this.entityClass, name); } return sqlFieldInfo; }
@Override public TaskableMethodConfig getTaskableMethodConfig(String taskName) throws UnifyException { TaskableMethodConfig bmtc = taskConfigByNameMap.get(taskName); if (bmtc == null) { throw new UnifyException(UnifyCoreErrorConstants.TASKABLE_METHOD_UNKNOWN, taskName); } return bmtc; }
@Override public UplElement getChildElementByLongName(String longName) throws UnifyException { UplElement uplElement = uplElementByLongNameMap.get(longName); if (uplElement == null) { throw new UnifyException(UnifyCoreErrorConstants.PAGEUTIL_MISSING_ELEMENT, longName); } return uplElement; }
public static String getEventJS(String eventType) throws UnifyException { String eventJS = eventToJSMap.get(eventType); if (eventJS == null) { throw new UnifyException(UnifyWebErrorConstants.MISSING_ACTION_HANDLER, eventType); } return eventJS; }
public String getLongName(String pageName) throws UnifyException { String longName = longNameByPageNameMap.get(pageName); if (longName == null) { throw new UnifyException(UnifyCoreErrorConstants.UNKNOWN_PAGE_NAME, pageName); } return longName; }
@SuppressWarnings("unchecked") @Override public <T> T getAttributeValue(Class<T> clazz, String name) throws UnifyException { if (!uplAttributes.containsKey(name)) { throw new UnifyException(UnifyCoreErrorConstants.UPL_COMPONENT_ATTRIBUTE_UNKNOWN, elementType, name); } return (T) uplAttributes.get(name); }
@Override public void stopLocalUnicastServer(String configName) throws UnifyException { LocalUnicastServer localUnicastServer = localUnicastServers.remove(configName); if (localUnicastServer == null) { throw new UnifyException(UnifyCoreErrorConstants.NETWORKINTERFACE_UNICASTSERVER_NOT_STARTED, configName); } localUnicastServer.close(); }
private SqlStatementExecutor getSqlStatementExecutor() throws UnifyException { if (closed) { throw new UnifyException(UnifyCoreErrorConstants.DATASOURCE_SESSION_IS_CLOSED, getDataSourceName()); } return sqlStatementExecutor; } }
@Override public void endTransaction() throws UnifyException { try { transactionsThreadLocal.get().pop().leave(); if (transactionsThreadLocal.get().isEmpty()) { transactionsThreadLocal.remove(); } } catch (RuntimeException e) { throw new UnifyException(e, UnifyCoreErrorConstants.TRANSACTION_IS_ALREADY_COMPLETED); } }
public Object getValue(String name) throws UnifyException { MapValue mapValue = this.map.get(name); if (mapValue == null) { throw new UnifyException(UnifyCoreErrorConstants.MAPVALUESTORE_NO_SUCH_ENTRY, name); } return mapValue.getValue(); }
protected void checkConfiguration(String configurationCode) throws UnifyException { if (!configurations.isKey(configurationCode)) { throw new UnifyException(UnifyCoreErrorConstants.EMAILSERVER_CONFIGURATION_UNKNOWN, configurationCode); } }
public void initialize() throws UnifyException { try { for (int i = 0; i < minSize; i++) { availableObjects.add(createObject()); } } catch (UnifyException e) { throw e; } catch (Exception e) { throw new UnifyException(e, UnifyCoreErrorConstants.GENERIC_OBJECT_POOL_ERROR, e.getMessage()); } }
public String getMessage(Locale locale, String messageKey) throws UnifyException { String message = resourceBundles.get(locale).get(messageKey); if (message == null) { throw new UnifyException(UnifyCoreErrorConstants.COMPONENT_MISSING_RESOURCE, messageKey); } return message; }
public WfStepDef getWfStepDef(String stepName) throws UnifyException { WfStepDef wfStepDef = this.steps.get(stepName); if (wfStepDef == null) { throw new UnifyException(WorkflowModuleErrorConstants.WORKFLOW_STEP_WITH_NAME_UNKNOWN, this.getDescription(), stepName); } return wfStepDef; } }
public Builder<T> addCategory(TreeItemCategoryInfo treeCategoryInfo) throws UnifyException { if (categories.containsKey(treeCategoryInfo.getName())) { throw new UnifyException(UnifyCoreErrorConstants.COMPONENT_OPERATION_ERROR, "Category with name [" + treeCategoryInfo.getName() + "] exists."); } categories.put(treeCategoryInfo.getName(), treeCategoryInfo); return this; }
public void setValue(String name, Object value, Formatter<?> formatter) throws UnifyException { MapValue mapValue = this.map.get(name); if (mapValue == null) { throw new UnifyException(UnifyCoreErrorConstants.MAPVALUESTORE_NO_SUCH_ENTRY, name); } mapValue.setValue(DataUtils.convert(mapValue.getType(), value, formatter)); }
public static String writeJsonObject(Object object) throws UnifyException { try { JsonObject jsonObject = Json.object(); DataUtils.writeJsonObject(object, jsonObject); return jsonObject.toString(); } catch (UnifyException e) { throw e; } catch (Exception e) { throw new UnifyException(UnifyCoreErrorConstants.DATAUTIL_ERROR, e); } }
@Override public void configure(DynamicSqlDataSourceConfig dynamicSqlDataSourceConfig) throws UnifyException { if (isConfigured()) { throw new UnifyException(UnifyCoreErrorConstants.DYNAMIC_DATASOURCE_ALREADY_CONFIGURED, dynamicSqlDataSourceConfig.getName()); } innerConfigure(dynamicSqlDataSourceConfig); }
private BatchFileReadConfig getBatchUploadConfig(String name) throws UnifyException { BatchFileReadConfig batchFileReadConfig = db().list(new BatchFileReadConfigQuery().name(name)); if (batchFileReadConfig == null) { throw new UnifyException(FileModuleErrorConstants.BATCHUPLOADCONFIG_NAME_UNKNOWN, name); } return batchFileReadConfig; }
@Override public APIDiscoveryRemoteCallInfo getRemoteCallInfo(String code) throws UnifyException { RemoteCallInfo rci = this.remoteCallInfos.get(code); if (rci == null) { throw new UnifyException(UnifyWebErrorConstants.APIDISCOVERY_REMOTECALL_CODE_UNKNOWN, code); } return new APIDiscoveryRemoteCallInfo(rci.getCode(), rci.getDescription(), this.getSessionContext().getUriBase() + this.getSessionContext().getContextPath() + rci.getPath(), rci.isRestricted()); }