@Test(expected = IllegalStateException.class) public void testHandlePropInfoNotInitialized() throws Exception { importer.handlePropInfo(createUserTree(), mock(PropInfo.class), mock(PropertyDefinition.class)); }
@Override public boolean handlePropInfo(@NotNull Tree parent, @NotNull PropInfo propInfo, @NotNull PropertyDefinition def) throws RepositoryException { checkInitialized(); if (isPwdNode(parent)) { return importPwdNodeProperty(parent, propInfo, def); } else { Authorizable a = userManager.getAuthorizable(parent); if (a == null) { log.debug("Cannot handle protected PropInfo {}. Node {} doesn't represent an Authorizable.", propInfo, parent); return false; } String propName = propInfo.getName(); if (REP_AUTHORIZABLE_ID.equals(propName)) { return importAuthorizableId(parent, a, propInfo, def); } else if (REP_PRINCIPAL_NAME.equals(propName)) { return importPrincipalName(parent, a, propInfo, def); } else if (REP_PASSWORD.equals(propName)) { return importPassword(parent, a, propInfo, def); } else if (REP_IMPERSONATORS.equals(propName)) { return importImpersonators(parent, a, propInfo, def); } else if (REP_DISABLED.equals(propName)) { return importDisabled(a, propInfo, def); } else if (REP_MEMBERS.equals(propName)) { if (!a.isGroup() || !isValid(def, NT_REP_MEMBER_REFERENCES, true)) { return false; } getMembership(a.getPath()).addMembers(propInfo.getTextValues()); return true; } } return false; }
UserImporter implements ProtectedPropertyImporter, ProtectedNodeImporter, UserConstants { @Override public boolean handlePropInfo(@NotNull Tree parent, @NotNull PropInfo propInfo, @NotNull PropertyDefinition def) throws RepositoryException { checkInitialized(); if (isPwdNode(parent)) { return importPwdNodeProperty(parent, propInfo, def); } else { Authorizable a = userManager.getAuthorizable(parent); if (a == null) { log.debug("Cannot handle protected PropInfo {}. Node {} doesn't represent an Authorizable.", propInfo, parent); return false; } String propName = propInfo.getName(); if (REP_AUTHORIZABLE_ID.equals(propName)) { return importAuthorizableId(parent, a, propInfo, def); } else if (REP_PRINCIPAL_NAME.equals(propName)) { return importPrincipalName(parent, a, propInfo, def); } else if (REP_PASSWORD.equals(propName)) { return importPassword(parent, a, propInfo, def); } else if (REP_IMPERSONATORS.equals(propName)) { return importImpersonators(parent, a, propInfo, def); } else if (REP_DISABLED.equals(propName)) { return importDisabled(a, propInfo, def); } else if (REP_MEMBERS.equals(propName)) { if (!a.isGroup() || !isValid(def, NT_REP_MEMBER_REFERENCES, true)) { return false; } getMembership(a.getPath()).addMembers(propInfo.getTextValues()); return true; } } return false; } }
UserImporter implements ProtectedPropertyImporter, ProtectedNodeImporter, UserConstants { @Override public boolean handlePropInfo(@NotNull Tree parent, @NotNull PropInfo propInfo, @NotNull PropertyDefinition def) throws RepositoryException { checkInitialized(); if (isPwdNode(parent)) { return importPwdNodeProperty(parent, propInfo, def); } else { Authorizable a = userManager.getAuthorizable(parent); if (a == null) { log.debug("Cannot handle protected PropInfo {}. Node {} doesn't represent an Authorizable.", propInfo, parent); return false; } String propName = propInfo.getName(); if (REP_AUTHORIZABLE_ID.equals(propName)) { return importAuthorizableId(parent, a, propInfo, def); } else if (REP_PRINCIPAL_NAME.equals(propName)) { return importPrincipalName(parent, a, propInfo, def); } else if (REP_PASSWORD.equals(propName)) { return importPassword(parent, a, propInfo, def); } else if (REP_IMPERSONATORS.equals(propName)) { return importImpersonators(parent, a, propInfo, def); } else if (REP_DISABLED.equals(propName)) { return importDisabled(a, propInfo, def); } else if (REP_MEMBERS.equals(propName)) { if (!a.isGroup() || !isValid(def, NT_REP_MEMBER_REFERENCES, true)) { return false; } getMembership(a.getPath()).addMembers(propInfo.getTextValues()); return true; } } return false; } UserImporter(ConfigurationParameters config); }
UserImporter implements ProtectedPropertyImporter, ProtectedNodeImporter, UserConstants { @Override public boolean handlePropInfo(@NotNull Tree parent, @NotNull PropInfo propInfo, @NotNull PropertyDefinition def) throws RepositoryException { checkInitialized(); if (isPwdNode(parent)) { return importPwdNodeProperty(parent, propInfo, def); } else { Authorizable a = userManager.getAuthorizable(parent); if (a == null) { log.debug("Cannot handle protected PropInfo {}. Node {} doesn't represent an Authorizable.", propInfo, parent); return false; } String propName = propInfo.getName(); if (REP_AUTHORIZABLE_ID.equals(propName)) { return importAuthorizableId(parent, a, propInfo, def); } else if (REP_PRINCIPAL_NAME.equals(propName)) { return importPrincipalName(parent, a, propInfo, def); } else if (REP_PASSWORD.equals(propName)) { return importPassword(parent, a, propInfo, def); } else if (REP_IMPERSONATORS.equals(propName)) { return importImpersonators(parent, a, propInfo, def); } else if (REP_DISABLED.equals(propName)) { return importDisabled(a, propInfo, def); } else if (REP_MEMBERS.equals(propName)) { if (!a.isGroup() || !isValid(def, NT_REP_MEMBER_REFERENCES, true)) { return false; } getMembership(a.getPath()).addMembers(propInfo.getTextValues()); return true; } } return false; } UserImporter(ConfigurationParameters config); @Override boolean init(@NotNull Session session, @NotNull Root root, @NotNull NamePathMapper namePathMapper,
            boolean isWorkspaceImport, int uuidBehavior,
            @NotNull ReferenceChangeTracker referenceTracker, @NotNull SecurityProvider securityProvider); @Override boolean handlePropInfo(@NotNull Tree parent, @NotNull PropInfo propInfo, @NotNull PropertyDefinition def); @Override void propertiesCompleted(@NotNull Tree protectedParent); @Override void processReferences(); @Override boolean start(@NotNull Tree protectedParent); @Override void startChildInfo(@NotNull NodeInfo childInfo, @NotNull List<PropInfo> propInfos); @Override void endChildInfo(); @Override void end(@NotNull Tree protectedParent); }
UserImporter implements ProtectedPropertyImporter, ProtectedNodeImporter, UserConstants { @Override public boolean handlePropInfo(@NotNull Tree parent, @NotNull PropInfo propInfo, @NotNull PropertyDefinition def) throws RepositoryException { checkInitialized(); if (isPwdNode(parent)) { return importPwdNodeProperty(parent, propInfo, def); } else { Authorizable a = userManager.getAuthorizable(parent); if (a == null) { log.debug("Cannot handle protected PropInfo {}. Node {} doesn't represent an Authorizable.", propInfo, parent); return false; } String propName = propInfo.getName(); if (REP_AUTHORIZABLE_ID.equals(propName)) { return importAuthorizableId(parent, a, propInfo, def); } else if (REP_PRINCIPAL_NAME.equals(propName)) { return importPrincipalName(parent, a, propInfo, def); } else if (REP_PASSWORD.equals(propName)) { return importPassword(parent, a, propInfo, def); } else if (REP_IMPERSONATORS.equals(propName)) { return importImpersonators(parent, a, propInfo, def); } else if (REP_DISABLED.equals(propName)) { return importDisabled(a, propInfo, def); } else if (REP_MEMBERS.equals(propName)) { if (!a.isGroup() || !isValid(def, NT_REP_MEMBER_REFERENCES, true)) { return false; } getMembership(a.getPath()).addMembers(propInfo.getTextValues()); return true; } } return false; } UserImporter(ConfigurationParameters config); @Override boolean init(@NotNull Session session, @NotNull Root root, @NotNull NamePathMapper namePathMapper,
            boolean isWorkspaceImport, int uuidBehavior,
            @NotNull ReferenceChangeTracker referenceTracker, @NotNull SecurityProvider securityProvider); @Override boolean handlePropInfo(@NotNull Tree parent, @NotNull PropInfo propInfo, @NotNull PropertyDefinition def); @Override void propertiesCompleted(@NotNull Tree protectedParent); @Override void processReferences(); @Override boolean start(@NotNull Tree protectedParent); @Override void startChildInfo(@NotNull NodeInfo childInfo, @NotNull List<PropInfo> propInfos); @Override void endChildInfo(); @Override void end(@NotNull Tree protectedParent);  }