use of org.apache.syncope.client.console.rest.ConnectorRestClient in project syncope by apache.
the class HistoryConfDetails method addCurrentInstanceConf.
@SuppressWarnings("unchecked")
private void addCurrentInstanceConf() {
T conf = null;
if (selectedHistoryConfTO instanceof ConnInstanceHistoryConfTO) {
ConnInstanceTO current = new ConnectorRestClient().read(ConnInstanceHistoryConfTO.class.cast(selectedHistoryConfTO).getConnInstanceTO().getKey());
conf = (T) new ConnInstanceHistoryConfTO();
((ConnInstanceHistoryConfTO) conf).setConnInstanceTO(current);
} else if (selectedHistoryConfTO instanceof ResourceHistoryConfTO) {
ResourceTO current = new ResourceRestClient().read(ResourceHistoryConfTO.class.cast(selectedHistoryConfTO).getResourceTO().getKey());
conf = (T) new ResourceHistoryConfTO();
((ResourceHistoryConfTO) conf).setResourceTO(current);
}
if (conf != null) {
conf.setCreator(selectedHistoryConfTO.getCreator());
conf.setKey("current");
availableHistoryConfTOs.add(conf);
}
}
use of org.apache.syncope.client.console.rest.ConnectorRestClient in project syncope by apache.
the class TopologyNodePanel method onEvent.
@Override
public void onEvent(final IEvent<?> event) {
if (event.getPayload() instanceof UpdateEvent) {
final UpdateEvent updateEvent = UpdateEvent.class.cast(event.getPayload());
final String key = updateEvent.getKey();
final AjaxRequestTarget target = updateEvent.getTarget();
if (node.getKind() == Kind.CONNECTOR && key.equalsIgnoreCase(node.getKey())) {
ConnInstanceTO conn = new ConnectorRestClient().read(key);
String displayName = // [SYNCOPE-1233]
StringUtils.isBlank(conn.getDisplayName()) ? conn.getBundleName() : conn.getDisplayName();
final String resourceName = displayName.length() > 14 ? displayName.subSequence(0, 10) + "..." : displayName;
label.setDefaultModelObject(resourceName);
target.add(label);
node.setDisplayName(displayName);
}
}
}
Aggregations