/** * Create or retrieve a SimpleProxyId. */ public <P extends BaseProxy> SimpleProxyId<P> getId(String typeToken, String serverId) { return getId(typeToken, serverId, 0); }
/** * Create or retrieve a SimpleProxyId. If both the serverId and clientId are * specified and the id is ephemeral, it will be updated with the server id. */ public <P extends BaseProxy> SimpleProxyId<P> getId(Class<P> clazz, String serverId, int clientId) { return getId(getTypeToken(clazz), serverId, clientId); }
public <P extends BaseProxy> SimpleProxyId<P> getBaseProxyId( String historyToken) { assert !IdUtil.isSynthetic(historyToken) : "Synthetic id resolution" + " should be handled by AbstractRequestContext"; if (IdUtil.isPersisted(historyToken)) { return getId(IdUtil.getTypeToken(historyToken), IdUtil.getServerId(historyToken)); } if (IdUtil.isEphemeral(historyToken)) { @SuppressWarnings("unchecked") SimpleProxyId<P> toReturn = (SimpleProxyId<P>) ephemeralIds.get(historyToken); /* * This is tested in FindServiceTest.testFetchUnpersistedFutureId. In * order to get here, the user would have to get an unpersisted history * token and attempt to use it with a different RequestFactory instance. * This could occur if an ephemeral token were bookmarked. In this case, * we'll create a token, however it will never match anything. */ if (toReturn == null) { Class<P> clazz = checkTypeToken(IdUtil.getTypeToken(historyToken)); toReturn = createId(clazz, -1 * ephemeralIds.size()); ephemeralIds.put(historyToken, toReturn); } return toReturn; } throw new IllegalArgumentException(historyToken); }
/** * Get or create BaseProxy AutoBeans for a list of id-bearing messages. */ public List<AutoBean<? extends BaseProxy>> getBeansForPayload(List<? extends IdMessage> idMessages) { List<SimpleProxyId<?>> ids = new ArrayList<SimpleProxyId<?>>(idMessages.size()); for (IdMessage idMessage : idMessages) { SimpleProxyId<?> id; if (Strength.SYNTHETIC.equals(idMessage.getStrength())) { Class<? extends BaseProxy> clazz = service.resolveClass(idMessage.getTypeToken()); id = idFactory.allocateSyntheticId(clazz, idMessage.getSyntheticId()); } else { String decodedId = idMessage.getServerId() == null ? null : SimpleRequestProcessor.fromBase64(idMessage .getServerId()); id = idFactory.getId(idMessage.getTypeToken(), decodedId, idMessage.getClientId()); } ids.add(id); } return getBeansForIds(ids); }
/** * Create or retrieve a SimpleProxyId. */ public <P extends BaseProxy> SimpleProxyId<P> getId(String typeToken, String serverId) { return getId(typeToken, serverId, 0); }
/** * Create or retrieve a SimpleProxyId. */ public <P extends BaseProxy> SimpleProxyId<P> getId(String typeToken, String serverId) { return getId(typeToken, serverId, 0); }
/** * Create or retrieve a SimpleProxyId. */ public <P extends BaseProxy> SimpleProxyId<P> getId(String typeToken, String serverId) { return getId(typeToken, serverId, 0); }
/** * Create or retrieve a SimpleProxyId. If both the serverId and clientId are * specified and the id is ephemeral, it will be updated with the server id. */ public <P extends BaseProxy> SimpleProxyId<P> getId(Class<P> clazz, String serverId, int clientId) { return getId(getTypeToken(clazz), serverId, clientId); }
/** * Create or retrieve a SimpleProxyId. If both the serverId and clientId are * specified and the id is ephemeral, it will be updated with the server id. */ public <P extends BaseProxy> SimpleProxyId<P> getId(Class<P> clazz, String serverId, int clientId) { return getId(getTypeToken(clazz), serverId, clientId); }
/** * Create or retrieve a SimpleProxyId. If both the serverId and clientId are * specified and the id is ephemeral, it will be updated with the server id. */ public <P extends BaseProxy> SimpleProxyId<P> getId(Class<P> clazz, String serverId, int clientId) { return getId(getTypeToken(clazz), serverId, clientId); }
} else { Splittable flatValue = state.flatten(domainId); id = state.getIdFactory().getId(proxyType, flatValue.getPayload(), 0);
public <P extends BaseProxy> SimpleProxyId<P> getBaseProxyId( String historyToken) { assert !IdUtil.isSynthetic(historyToken) : "Synthetic id resolution" + " should be handled by AbstractRequestContext"; if (IdUtil.isPersisted(historyToken)) { return getId(IdUtil.getTypeToken(historyToken), IdUtil.getServerId(historyToken)); } if (IdUtil.isEphemeral(historyToken)) { @SuppressWarnings("unchecked") SimpleProxyId<P> toReturn = (SimpleProxyId<P>) ephemeralIds.get(historyToken); /* * This is tested in FindServiceTest.testFetchUnpersistedFutureId. In * order to get here, the user would have to get an unpersisted history * token and attempt to use it with a different RequestFactory instance. * This could occur if an ephemeral token were bookmarked. In this case, * we'll create a token, however it will never match anything. */ if (toReturn == null) { Class<P> clazz = checkTypeToken(IdUtil.getTypeToken(historyToken)); toReturn = createId(clazz, -1 * ephemeralIds.size()); ephemeralIds.put(historyToken, toReturn); } return toReturn; } throw new IllegalArgumentException(historyToken); }
public <P extends BaseProxy> SimpleProxyId<P> getBaseProxyId( String historyToken) { assert !IdUtil.isSynthetic(historyToken) : "Synthetic id resolution" + " should be handled by AbstractRequestContext"; if (IdUtil.isPersisted(historyToken)) { return getId(IdUtil.getTypeToken(historyToken), IdUtil.getServerId(historyToken)); } if (IdUtil.isEphemeral(historyToken)) { @SuppressWarnings("unchecked") SimpleProxyId<P> toReturn = (SimpleProxyId<P>) ephemeralIds.get(historyToken); /* * This is tested in FindServiceTest.testFetchUnpersistedFutureId. In * order to get here, the user would have to get an unpersisted history * token and attempt to use it with a different RequestFactory instance. * This could occur if an ephemeral token were bookmarked. In this case, * we'll create a token, however it will never match anything. */ if (toReturn == null) { Class<P> clazz = checkTypeToken(IdUtil.getTypeToken(historyToken)); toReturn = createId(clazz, -1 * ephemeralIds.size()); ephemeralIds.put(historyToken, toReturn); } return toReturn; } throw new IllegalArgumentException(historyToken); }
public <P extends BaseProxy> SimpleProxyId<P> getBaseProxyId( String historyToken) { assert !IdUtil.isSynthetic(historyToken) : "Synthetic id resolution" + " should be handled by AbstractRequestContext"; if (IdUtil.isPersisted(historyToken)) { return getId(IdUtil.getTypeToken(historyToken), IdUtil.getServerId(historyToken)); } if (IdUtil.isEphemeral(historyToken)) { @SuppressWarnings("unchecked") SimpleProxyId<P> toReturn = (SimpleProxyId<P>) ephemeralIds.get(historyToken); /* * This is tested in FindServiceTest.testFetchUnpersistedFutureId. In * order to get here, the user would have to get an unpersisted history * token and attempt to use it with a different RequestFactory instance. * This could occur if an ephemeral token were bookmarked. In this case, * we'll create a token, however it will never match anything. */ if (toReturn == null) { Class<P> clazz = checkTypeToken(IdUtil.getTypeToken(historyToken)); toReturn = createId(clazz, -1 * ephemeralIds.size()); ephemeralIds.put(historyToken, toReturn); } return toReturn; } throw new IllegalArgumentException(historyToken); }
/** * Get or create BaseProxy AutoBeans for a list of id-bearing messages. */ public List<AutoBean<? extends BaseProxy>> getBeansForPayload(List<? extends IdMessage> idMessages) { List<SimpleProxyId<?>> ids = new ArrayList<SimpleProxyId<?>>(idMessages.size()); for (IdMessage idMessage : idMessages) { SimpleProxyId<?> id; if (Strength.SYNTHETIC.equals(idMessage.getStrength())) { Class<? extends BaseProxy> clazz = service.resolveClass(idMessage.getTypeToken()); id = idFactory.allocateSyntheticId(clazz, idMessage.getSyntheticId()); } else { String decodedId = idMessage.getServerId() == null ? null : SimpleRequestProcessor.fromBase64(idMessage .getServerId()); id = idFactory.getId(idMessage.getTypeToken(), decodedId, idMessage.getClientId()); } ids.add(id); } return getBeansForIds(ids); }
/** * Get or create BaseProxy AutoBeans for a list of id-bearing messages. */ public List<AutoBean<? extends BaseProxy>> getBeansForPayload(List<? extends IdMessage> idMessages) { List<SimpleProxyId<?>> ids = new ArrayList<SimpleProxyId<?>>(idMessages.size()); for (IdMessage idMessage : idMessages) { SimpleProxyId<?> id; if (Strength.SYNTHETIC.equals(idMessage.getStrength())) { Class<? extends BaseProxy> clazz = service.resolveClass(idMessage.getTypeToken()); id = idFactory.allocateSyntheticId(clazz, idMessage.getSyntheticId()); } else { String decodedId = idMessage.getServerId() == null ? null : SimpleRequestProcessor.fromBase64(idMessage .getServerId()); id = idFactory.getId(idMessage.getTypeToken(), decodedId, idMessage.getClientId()); } ids.add(id); } return getBeansForIds(ids); }
/** * Get or create BaseProxy AutoBeans for a list of id-bearing messages. */ public List<AutoBean<? extends BaseProxy>> getBeansForPayload(List<? extends IdMessage> idMessages) { List<SimpleProxyId<?>> ids = new ArrayList<SimpleProxyId<?>>(idMessages.size()); for (IdMessage idMessage : idMessages) { SimpleProxyId<?> id; if (Strength.SYNTHETIC.equals(idMessage.getStrength())) { Class<? extends BaseProxy> clazz = service.resolveClass(idMessage.getTypeToken()); id = idFactory.allocateSyntheticId(clazz, idMessage.getSyntheticId()); } else { String decodedId = idMessage.getServerId() == null ? null : SimpleRequestProcessor.fromBase64(idMessage .getServerId()); id = idFactory.getId(idMessage.getTypeToken(), decodedId, idMessage.getClientId()); } ids.add(id); } return getBeansForIds(ids); }
} else { Splittable flatValue = state.flatten(domainId); id = state.getIdFactory().getId(proxyType, flatValue.getPayload(), 0);
} else { Splittable flatValue = state.flatten(domainId); id = state.getIdFactory().getId(proxyType, flatValue.getPayload(), 0);
} else { Splittable flatValue = state.flatten(domainId); id = state.getIdFactory().getId(proxyType, flatValue.getPayload(), 0);