public ManagementAPI getManagementAPI() { return getManagementAPI(AccessorUtil.QUERYLIST_DEFAULT_KEY); }
public ManagementAPI getManagementAPI() { return getManagementAPI(AccessorUtil.QUERYLIST_DEFAULT_KEY); }
public Long execute(Environment environment) throws Exception { long newProcessInstanceNb; final String metaName = getMetadataName(processUUID); StandardAPIAccessorImpl accessor = new StandardAPIAccessorImpl(); final ManagementAPI managementAPI = accessor.getManagementAPI(); long lastInMemory = 0; final Long uuidValue = getUUIDValue(processUUID); if (uuidValue != null) { lastInMemory = uuidValue; } if (LOG.isLoggable(Level.FINE)) { LOG.fine("Last process instance number found in memory: " + lastInMemory); } long lastInDb = 0; final String metadataValue = managementAPI.getMetaData(metaName); if (metadataValue != null) { lastInDb = Long.valueOf(metadataValue); } if (LOG.isLoggable(Level.FINE)) { LOG.fine("Last process instance number found in database: " + lastInDb); } newProcessInstanceNb = Math.max(lastInDb, lastInMemory) + 1; setUUIDValue(processUUID, newProcessInstanceNb); managementAPI.addMetaData(metaName, Long.toString(newProcessInstanceNb)); return newProcessInstanceNb; } }
protected ManagementAPI getAPI(final Map<String, String> options) { if (options == null) { throw new IllegalArgumentException("The options are null or not well set."); } final String queryList = options.get(APIAccessor.QUERYLIST_OPTION); final String user = options.get(APIAccessor.USER_OPTION); final String domain = options.get(APIAccessor.DOMAIN_OPTION); final String restUser = options.get(APIAccessor.REST_USER_OPTION); UserOwner.setUser(user); DomainOwner.setDomain(domain); if (restUser != null) { RESTUserOwner.setUser(restUser); final String restPswd = options.get(APIAccessor.PASSWORD_HASH_OPTION); PasswordOwner.setPassword(restPswd); } if (!apis.containsKey(queryList)) { apis.put(queryList, new StandardAPIAccessorImpl().getManagementAPI(queryList)); } return apis.get(queryList); }
protected ManagementAPI getAPI() { Authentication.setUserId(ctx.getCallerPrincipal().getName()); AccessorUtil.setContext(Context.Standard); if (managementAPI == null) { managementAPI = new StandardAPIAccessorImpl().getManagementAPI(); } return managementAPI; }
public void archiveOrDeleteProcess(ProcessDefinitionUUID processUUID) { synchronized (getMutex(processUUID)) { final StandardAPIAccessorImpl accessor = new StandardAPIAccessorImpl(); final ManagementAPI managementAPI = accessor.getManagementAPI(); final String metadataName = getMetadataName(processUUID); managementAPI.deleteMetaData(metadataName); removeUUID(processUUID); } }