use of org.apache.syncope.common.lib.to.AccessTokenTO in project syncope by apache.
the class AccessTokenDataBinderImpl method getAccessTokenTO.
@Override
public AccessTokenTO getAccessTokenTO(final AccessToken accessToken) {
AccessTokenTO accessTokenTO = new AccessTokenTO();
BeanUtils.copyProperties(accessToken, accessTokenTO, IGNORE_PROPERTIES);
accessTokenTO.setOwner(accessToken.getOwner());
return accessTokenTO;
}
use of org.apache.syncope.common.lib.to.AccessTokenTO in project syncope by apache.
the class AccessTokenDirectoryPanel method getColumns.
@Override
protected List<IColumn<AccessTokenTO, String>> getColumns() {
List<IColumn<AccessTokenTO, String>> columns = new ArrayList<>();
columns.add(new KeyPropertyColumn<>(new StringResourceModel(Constants.KEY_FIELD_NAME, this), Constants.KEY_FIELD_NAME, Constants.KEY_FIELD_NAME));
columns.add(new PropertyColumn<>(new ResourceModel("owner"), "owner", "owner"));
columns.add(new AbstractColumn<AccessTokenTO, String>(new ResourceModel("issuedAt", "")) {
private static final long serialVersionUID = -1822504503325964706L;
@Override
public void populateItem(final Item<ICellPopulator<AccessTokenTO>> cellItem, final String componentId, final IModel<AccessTokenTO> model) {
JwsJwtCompactConsumer consumer = new JwsJwtCompactConsumer(model.getObject().getBody());
cellItem.add(new Label(componentId, SyncopeConsoleSession.get().getDateFormat().format(new Date(consumer.getJwtClaims().getIssuedAt()))));
}
});
columns.add(new DatePropertyColumn<>(new ResourceModel("expiryTime"), "expiryTime", "expiryTime"));
return columns;
}
Aggregations