@Test( expected = KException.class ) public void shouldFailWhenChildNotFound() throws Exception { this.dataRole.getChild( getTransaction(), "bogus" ); }
@Override public KomodoObject getChild( final UnitOfWork transaction, final String name ) throws KException { ArgCheck.isNotNull( transaction, "transaction" ); ArgCheck.isTrue( ( transaction.getState() == State.NOT_STARTED ), "transaction state must be NOT_STARTED" ); ArgCheck.isNotEmpty( name, "name" ); final KomodoObject[] matches = getPermissions( transaction, name ); if ( matches.length != 0 ) { return matches[ 0 ]; } throw new KException( Messages.getString( org.komodo.repository.Messages.Komodo.CHILD_NOT_FOUND, name, getAbsolutePath() ) ); }
DataRoleImpl extends RelationalObjectImpl implements DataRole { @Override public KomodoObject getChild( final UnitOfWork transaction, final String name ) throws KException { ArgCheck.isNotNull( transaction, "transaction" ); ArgCheck.isTrue( ( transaction.getState() == State.NOT_STARTED ), "transaction state must be NOT_STARTED" ); ArgCheck.isNotEmpty( name, "name" ); final KomodoObject[] matches = getPermissions( transaction, name ); if ( matches.length != 0 ) { return matches[ 0 ]; } throw new KException( Messages.getString( org.komodo.repository.Messages.Komodo.CHILD_NOT_FOUND, name, getAbsolutePath() ) ); } }
DataRoleImpl extends RelationalObjectImpl implements DataRole { @Override public KomodoObject getChild( final UnitOfWork transaction, final String name ) throws KException { ArgCheck.isNotNull( transaction, "transaction" ); ArgCheck.isTrue( ( transaction.getState() == State.NOT_STARTED ), "transaction state must be NOT_STARTED" ); ArgCheck.isNotEmpty( name, "name" ); final KomodoObject[] matches = getPermissions( transaction, name ); if ( matches.length != 0 ) { return matches[ 0 ]; } throw new KException( Messages.getString( org.komodo.repository.Messages.Komodo.CHILD_NOT_FOUND, name, getAbsolutePath() ) ); } DataRoleImpl( final UnitOfWork uow,
                         final Repository repository,
                         final String workspacePath ); }
DataRoleImpl extends RelationalObjectImpl implements DataRole { @Override public KomodoObject getChild( final UnitOfWork transaction, final String name ) throws KException { ArgCheck.isNotNull( transaction, "transaction" ); ArgCheck.isTrue( ( transaction.getState() == State.NOT_STARTED ), "transaction state must be NOT_STARTED" ); ArgCheck.isNotEmpty( name, "name" ); final KomodoObject[] matches = getPermissions( transaction, name ); if ( matches.length != 0 ) { return matches[ 0 ]; } throw new KException( Messages.getString( org.komodo.repository.Messages.Komodo.CHILD_NOT_FOUND, name, getAbsolutePath() ) ); } DataRoleImpl( final UnitOfWork uow,
                         final Repository repository,
                         final String workspacePath ); @Override KomodoType getTypeIdentifier(UnitOfWork uow); @Override String[] addMappedRole( final UnitOfWork transaction,
                                   final String roleNameToAdd ); @Override Permission addPermission( final UnitOfWork transaction,
                                     final String permissionName ); @Override KomodoObject getChild( final UnitOfWork transaction,
                                  final String name ); @Override KomodoObject getChild( final UnitOfWork transaction,
                                  final String name,
                                  final String typeName ); @Override KomodoObject[] getChildren( final UnitOfWork transaction,
                                       final String... namePatterns ); @Override KomodoObject[] getChildrenOfType( final UnitOfWork transaction,
                                             final String type,
                                             final String... namePatterns ); @Override KomodoType[] getChildTypes(); @Override String getDescription( final UnitOfWork uow ); @Override String[] getMappedRoles( final UnitOfWork transaction,
                                    final String... namePatterns ); @Override Vdb getParent( final UnitOfWork transaction ); @Override Permission[] getPermissions( final UnitOfWork transaction,
                                        final String... namePatterns ); @Override int getTypeId(); @Override boolean hasChild( final UnitOfWork transaction,
                             final String name ); @Override boolean hasChild( final UnitOfWork transaction,
                             final String name,
                             final String typeName ); @Override boolean hasChildren( final UnitOfWork transaction ); @Override boolean isAllowCreateTempTables( final UnitOfWork uow ); @Override boolean isAnyAuthenticated( final UnitOfWork uow ); @Override boolean isGrantAll( final UnitOfWork uow ); @Override String[] removeMappedRole( final UnitOfWork transaction,
                                      final String roleNameToRemove ); @Override void removePermission( final UnitOfWork transaction,
                                  final String permissionToRemove ); @Override void setAllowCreateTempTables( final UnitOfWork uow,
                                          final boolean newAllowCreateTempTables ); @Override void setAnyAuthenticated( final UnitOfWork uow,
                                     final boolean newAnyAuthenticated ); @Override void setDescription( final UnitOfWork uow,
                                final String newDescription ); @Override void setGrantAll( final UnitOfWork uow,
                             final boolean newGrantAll ); }
DataRoleImpl extends RelationalObjectImpl implements DataRole { @Override public KomodoObject getChild( final UnitOfWork transaction, final String name ) throws KException { ArgCheck.isNotNull( transaction, "transaction" ); ArgCheck.isTrue( ( transaction.getState() == State.NOT_STARTED ), "transaction state must be NOT_STARTED" ); ArgCheck.isNotEmpty( name, "name" ); final KomodoObject[] matches = getPermissions( transaction, name ); if ( matches.length != 0 ) { return matches[ 0 ]; } throw new KException( Messages.getString( org.komodo.repository.Messages.Komodo.CHILD_NOT_FOUND, name, getAbsolutePath() ) ); } DataRoleImpl( final UnitOfWork uow,
                         final Repository repository,
                         final String workspacePath ); @Override KomodoType getTypeIdentifier(UnitOfWork uow); @Override String[] addMappedRole( final UnitOfWork transaction,
                                   final String roleNameToAdd ); @Override Permission addPermission( final UnitOfWork transaction,
                                     final String permissionName ); @Override KomodoObject getChild( final UnitOfWork transaction,
                                  final String name ); @Override KomodoObject getChild( final UnitOfWork transaction,
                                  final String name,
                                  final String typeName ); @Override KomodoObject[] getChildren( final UnitOfWork transaction,
                                       final String... namePatterns ); @Override KomodoObject[] getChildrenOfType( final UnitOfWork transaction,
                                             final String type,
                                             final String... namePatterns ); @Override KomodoType[] getChildTypes(); @Override String getDescription( final UnitOfWork uow ); @Override String[] getMappedRoles( final UnitOfWork transaction,
                                    final String... namePatterns ); @Override Vdb getParent( final UnitOfWork transaction ); @Override Permission[] getPermissions( final UnitOfWork transaction,
                                        final String... namePatterns ); @Override int getTypeId(); @Override boolean hasChild( final UnitOfWork transaction,
                             final String name ); @Override boolean hasChild( final UnitOfWork transaction,
                             final String name,
                             final String typeName ); @Override boolean hasChildren( final UnitOfWork transaction ); @Override boolean isAllowCreateTempTables( final UnitOfWork uow ); @Override boolean isAnyAuthenticated( final UnitOfWork uow ); @Override boolean isGrantAll( final UnitOfWork uow ); @Override String[] removeMappedRole( final UnitOfWork transaction,
                                      final String roleNameToRemove ); @Override void removePermission( final UnitOfWork transaction,
                                  final String permissionToRemove ); @Override void setAllowCreateTempTables( final UnitOfWork uow,
                                          final boolean newAllowCreateTempTables ); @Override void setAnyAuthenticated( final UnitOfWork uow,
                                     final boolean newAnyAuthenticated ); @Override void setDescription( final UnitOfWork uow,
                                final String newDescription ); @Override void setGrantAll( final UnitOfWork uow,
                             final boolean newGrantAll );  }