@Override public void receive(TokenStoreRemoveAccessTokenMsg message) { removeAccessTokenFromMemory(message.getTokenValue()); } });
@Override public void receive(TokenStoreRemoveRefreshTokenMsg message) { removeAccessTokenFromMemory(message.getTokenValue()); } });
@Override public void receive(TokenStoreAddAccessTokenMsg message) { storeAccessTokenToMemory(message.getAccessTokenValue(), message.getAccessTokenBytes(), message.getAuthenticationKey(), message.getAuthenticationBytes(), message.getTokenExpiry(), message.getUserLogin(), message.getRefreshTokenValue()); }
@Override public void receive(TokenStoreAddRefreshTokenMsg message) { storeRefreshTokenToMemory(message.getTokenValue(), message.getTokenBytes(), message.getAuthenticationBytes(), message.getTokenExpiry(), message.getUserLogin()); } });
@Override public void receive(TokenStorePutSessionInfoMsg message) { _putSessionInfo(message.getTokenValue(), message.getSessionInfo()); } });
protected MyJSONObject.Array _process(List<Entity> entities, MetaClass metaClass, View view) throws Exception { MyJSONObject.Array result = new MyJSONObject.Array(); for (Entity entity : entities) { MyJSON item = encodeInstance(entity, new HashSet<Entity>(), metaClass, view); result.add(item); } return result; }
private Object parseEntityReference(Node node, CommitRequest commitRequest) throws InstantiationException, IllegalAccessException, InvocationTargetException, IntrospectionException { Node childNode = node.getFirstChild(); if (ELEMENT_NULL_REF.equals(childNode.getNodeName())) { return null; } InstanceRef ref = commitRequest.parseInstanceRefAndRegister(getIdAttribute(childNode)); return ref.getInstance(); }
@Override public String process(List<Entity> entities, MetaClass metaClass, View view) throws Exception { Document document = _process(entities, metaClass, view); return documentToString(document); }
@Override public void removeAccessTokenUsingRefreshToken(String refreshTokenValue) { String accessTokenValue = getAccessTokenValueByRefreshTokenValue(refreshTokenValue); if (accessTokenValue != null) removeAccessToken(accessTokenValue); }
@Override public String process(Entity entity, MetaClass metaclass, View view) throws Exception { MyJSONObject jsonObject = encodeInstance(entity, new HashSet<Entity>(), metaclass, view); return jsonObject.toString(); }
@Override public RestUserSessionInfo putSessionInfo(String tokenValue, RestUserSessionInfo sessionInfo) { RestUserSessionInfo info = _putSessionInfo(tokenValue, sessionInfo); clusterManagerAPI.send(new TokenStorePutSessionInfoMsg(tokenValue, sessionInfo)); return info; }
protected void deleteExpiredRefreshTokensInMemory() { TokenExpiry expiry = refreshTokensExpiryQueue.poll(); while (expiry != null) { removeRefreshToken(expiry.getValue()); expiry = refreshTokensExpiryQueue.poll(); } }
protected void deleteExpiredAccessTokensInMemory() { TokenExpiry expiry = accessTokensExpiryQueue.poll(); while (expiry != null) { removeAccessToken(expiry.getValue()); expiry = accessTokensExpiryQueue.poll(); } }
private boolean removePermitted(MetaClass metaClass) { return entityOpPermitted(metaClass, EntityOp.DELETE); }
protected boolean attrViewPermitted(MetaClass metaClass, String property) { return attrPermitted(metaClass, property, EntityAttrAccess.VIEW); }
protected boolean updatePermitted(MetaClass metaClass) { return entityOpPermitted(metaClass, EntityOp.UPDATE); }
private void setNullField(Object bean, String fieldName) throws IllegalAccessException, InvocationTargetException, IntrospectionException { setField(bean, fieldName, null); }
@Override public String process(Entity entity, MetaClass metaclass, View view) throws Exception { Document document = _process(entity, view); return documentToString(document); }
private boolean createPermitted(MetaClass metaClass) { return entityOpPermitted(metaClass, EntityOp.CREATE); }