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); }
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); }