private void registerExtensionSchemas(SchemaRegistryImpl schemaRegistry) { try { List<String> schemas = getSchemaList(); for (String name : schemas) { String xsd = fetchSchema(name); ByteArrayInputStream bis = new ByteArrayInputStream(xsd.getBytes()); schemaRegistry.registerPrismSchema(bis, "rest " + name); } } catch (Exception ex) { throw new NinjaException("Couldn't register extension schema", ex); } }
public PrismContext getPrismContext() { if (prismContext != null) { return prismContext; } if (context != null) { prismContext = context.getBean(PrismContext.class); } if (restService != null) { prismContext = restService.getPrismContext(); } return prismContext; }
@Override public void execute() { RestService model = context.getRestService(); OperationResult result = model.testResource(options.getOid()); //todo print result } }
private RestService setupRestService(ConnectionOptions options) { log.info("Initializing rest service"); String url = options.getUrl(); String username = options.getUsername(); String password = getPassword(options); if (url == null) { throw new IllegalStateException("Url is not defined"); } return new RestService(url, username, password); }