@Test public void shouldNotHaveMakssAfterConstruction() throws Exception { assertThat( this.permission.getMasks( getTransaction() ), is( notNullValue() ) ); assertThat( this.permission.getMasks( getTransaction() ).length, is( 0 ) ); }
@Override public Mask[] getMasks( final UnitOfWork transaction, final String... namePatterns ) throws KException { ArgCheck.isNotNull( transaction, "transaction" ); ArgCheck.isTrue( ( transaction.getState() == State.NOT_STARTED ), "transaction state is not NOT_STARTED" ); Mask[] result = null; final KomodoObject grouping = getMasksGroupingNode( transaction ); if ( grouping != null ) { final List< Mask > temp = new ArrayList<>(); for ( final KomodoObject kobject : grouping.getChildrenOfType( transaction, VdbLexicon.DataRole.Permission.Mask.MASK, namePatterns ) ) { final Mask mask = new MaskImpl( transaction, getRepository(), kobject.getAbsolutePath() ); temp.add( mask ); } result = temp.toArray( new Mask[ temp.size() ] ); } else { result = Mask.NO_MASKS; } return result; }
PermissionImpl extends RelationalObjectImpl implements Permission { @Override public Mask[] getMasks( final UnitOfWork transaction, final String... namePatterns ) throws KException { ArgCheck.isNotNull( transaction, "transaction" ); ArgCheck.isTrue( ( transaction.getState() == State.NOT_STARTED ), "transaction state is not NOT_STARTED" ); Mask[] result = null; final KomodoObject grouping = getMasksGroupingNode( transaction ); if ( grouping != null ) { final List< Mask > temp = new ArrayList<>(); for ( final KomodoObject kobject : grouping.getChildrenOfType( transaction, VdbLexicon.DataRole.Permission.Mask.MASK, namePatterns ) ) { final Mask mask = new MaskImpl( transaction, getRepository(), kobject.getAbsolutePath() ); temp.add( mask ); } result = temp.toArray( new Mask[ temp.size() ] ); } else { result = Mask.NO_MASKS; } return result; } }
PermissionImpl extends RelationalObjectImpl implements Permission { @Override public Mask[] getMasks( final UnitOfWork transaction, final String... namePatterns ) throws KException { ArgCheck.isNotNull( transaction, "transaction" ); ArgCheck.isTrue( ( transaction.getState() == State.NOT_STARTED ), "transaction state is not NOT_STARTED" ); Mask[] result = null; final KomodoObject grouping = getMasksGroupingNode( transaction ); if ( grouping != null ) { final List< Mask > temp = new ArrayList<>(); for ( final KomodoObject kobject : grouping.getChildrenOfType( transaction, VdbLexicon.DataRole.Permission.Mask.MASK, namePatterns ) ) { final Mask mask = new MaskImpl( transaction, getRepository(), kobject.getAbsolutePath() ); temp.add( mask ); } result = temp.toArray( new Mask[ temp.size() ] ); } else { result = Mask.NO_MASKS; } return result; } PermissionImpl( final UnitOfWork uow,
                           final Repository repository,
                           final String workspacePath ); }
PermissionImpl extends RelationalObjectImpl implements Permission { @Override public Mask[] getMasks( final UnitOfWork transaction, final String... namePatterns ) throws KException { ArgCheck.isNotNull( transaction, "transaction" ); ArgCheck.isTrue( ( transaction.getState() == State.NOT_STARTED ), "transaction state is not NOT_STARTED" ); Mask[] result = null; final KomodoObject grouping = getMasksGroupingNode( transaction ); if ( grouping != null ) { final List< Mask > temp = new ArrayList<>(); for ( final KomodoObject kobject : grouping.getChildrenOfType( transaction, VdbLexicon.DataRole.Permission.Mask.MASK, namePatterns ) ) { final Mask mask = new MaskImpl( transaction, getRepository(), kobject.getAbsolutePath() ); temp.add( mask ); } result = temp.toArray( new Mask[ temp.size() ] ); } else { result = Mask.NO_MASKS; } return result; } PermissionImpl( final UnitOfWork uow,
                           final Repository repository,
                           final String workspacePath ); @Override KomodoType getTypeIdentifier(UnitOfWork uow); @Override Condition addCondition( final UnitOfWork transaction,
                                   final String conditionName ); @Override Mask addMask( final UnitOfWork transaction,
                         final String maskName ); @Override KomodoObject getChild( final UnitOfWork transaction,
                                  final String name ); @Override KomodoObject getChild( final UnitOfWork transaction,
                                  final String name,
                                  final String typeName ); @Override KomodoType[] getChildTypes(); @Override KomodoObject[] getChildren( final UnitOfWork transaction,
                                       final String... namePatterns ); @Override KomodoObject[] getChildrenOfType( final UnitOfWork transaction,
                                             final String type,
                                             final String... namePatterns ); @Override Condition[] getConditions( final UnitOfWork transaction,
                                      final String... namePatterns ); @Override Mask[] getMasks( final UnitOfWork transaction,
                            final String... namePatterns ); @Override DataRole getParent( final UnitOfWork transaction ); @Override String getResourceName( final UnitOfWork transaction ); @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( UnitOfWork transaction ); @Override boolean isAllowAlter( final UnitOfWork uow ); @Override boolean isAllowCreate( final UnitOfWork uow ); @Override boolean isAllowDelete( final UnitOfWork uow ); @Override boolean isAllowExecute( final UnitOfWork uow ); @Override boolean isAllowLanguage( final UnitOfWork uow ); @Override boolean isAllowRead( final UnitOfWork uow ); @Override boolean isAllowUpdate( final UnitOfWork uow ); @Override void removeCondition( final UnitOfWork transaction,
                                 final String conditionToRemove ); @Override void removeMask( final UnitOfWork transaction,
                            final String maskToRemove ); @Override void setAllowAlter( final UnitOfWork uow,
                               final boolean newAllowAlter ); @Override void setAllowCreate( final UnitOfWork uow,
                                final boolean newAllowCreate ); @Override void setAllowDelete( final UnitOfWork uow,
                                final boolean newAllowDelete ); @Override void setAllowExecute( final UnitOfWork uow,
                                 final boolean newAllowExecute ); @Override void setAllowLanguage( final UnitOfWork uow,
                                  final boolean newAllowLanguage ); @Override void setAllowRead( final UnitOfWork uow,
                              final boolean newAllowRead ); @Override void setAllowUpdate( final UnitOfWork uow,
                                final boolean newAllowUpdate ); }
PermissionImpl extends RelationalObjectImpl implements Permission { @Override public Mask[] getMasks( final UnitOfWork transaction, final String... namePatterns ) throws KException { ArgCheck.isNotNull( transaction, "transaction" ); ArgCheck.isTrue( ( transaction.getState() == State.NOT_STARTED ), "transaction state is not NOT_STARTED" ); Mask[] result = null; final KomodoObject grouping = getMasksGroupingNode( transaction ); if ( grouping != null ) { final List< Mask > temp = new ArrayList<>(); for ( final KomodoObject kobject : grouping.getChildrenOfType( transaction, VdbLexicon.DataRole.Permission.Mask.MASK, namePatterns ) ) { final Mask mask = new MaskImpl( transaction, getRepository(), kobject.getAbsolutePath() ); temp.add( mask ); } result = temp.toArray( new Mask[ temp.size() ] ); } else { result = Mask.NO_MASKS; } return result; } PermissionImpl( final UnitOfWork uow,
                           final Repository repository,
                           final String workspacePath ); @Override KomodoType getTypeIdentifier(UnitOfWork uow); @Override Condition addCondition( final UnitOfWork transaction,
                                   final String conditionName ); @Override Mask addMask( final UnitOfWork transaction,
                         final String maskName ); @Override KomodoObject getChild( final UnitOfWork transaction,
                                  final String name ); @Override KomodoObject getChild( final UnitOfWork transaction,
                                  final String name,
                                  final String typeName ); @Override KomodoType[] getChildTypes(); @Override KomodoObject[] getChildren( final UnitOfWork transaction,
                                       final String... namePatterns ); @Override KomodoObject[] getChildrenOfType( final UnitOfWork transaction,
                                             final String type,
                                             final String... namePatterns ); @Override Condition[] getConditions( final UnitOfWork transaction,
                                      final String... namePatterns ); @Override Mask[] getMasks( final UnitOfWork transaction,
                            final String... namePatterns ); @Override DataRole getParent( final UnitOfWork transaction ); @Override String getResourceName( final UnitOfWork transaction ); @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( UnitOfWork transaction ); @Override boolean isAllowAlter( final UnitOfWork uow ); @Override boolean isAllowCreate( final UnitOfWork uow ); @Override boolean isAllowDelete( final UnitOfWork uow ); @Override boolean isAllowExecute( final UnitOfWork uow ); @Override boolean isAllowLanguage( final UnitOfWork uow ); @Override boolean isAllowRead( final UnitOfWork uow ); @Override boolean isAllowUpdate( final UnitOfWork uow ); @Override void removeCondition( final UnitOfWork transaction,
                                 final String conditionToRemove ); @Override void removeMask( final UnitOfWork transaction,
                            final String maskToRemove ); @Override void setAllowAlter( final UnitOfWork uow,
                               final boolean newAllowAlter ); @Override void setAllowCreate( final UnitOfWork uow,
                                final boolean newAllowCreate ); @Override void setAllowDelete( final UnitOfWork uow,
                                final boolean newAllowDelete ); @Override void setAllowExecute( final UnitOfWork uow,
                                 final boolean newAllowExecute ); @Override void setAllowLanguage( final UnitOfWork uow,
                                  final boolean newAllowLanguage ); @Override void setAllowRead( final UnitOfWork uow,
                              final boolean newAllowRead ); @Override void setAllowUpdate( final UnitOfWork uow,
                                final boolean newAllowUpdate );  }