private Set < URI > listEntitiesWithType ( URI entityType , URI relationship , URI type ) { Set < URI > entities = ImmutableSet . of ( ) ; // Deal with services if ( entityType . toASCIIString ( ) . equals ( MSM . Service . getURI ( ) ) ) { // Get the adequate type if ( relationship . toASCIIString ( ) . equals ( MSM . hasInput . getURI ( ) ) ) { entities = this . serviceManager . listServicesWithInputType ( type ) ; } else if ( relationship . toASCIIString ( ) . equals ( MSM . hasOutput . getURI ( ) ) ) { entities = this . serviceManager . listServicesWithOutputType ( type ) ; } // Deal with operations } else if ( entityType . toASCIIString ( ) . equals ( MSM . Operation . getURI ( ) ) ) { // Get the adequate type if ( relationship . toASCIIString ( ) . equals ( MSM . hasInput . getURI ( ) ) ) { entities = this . serviceManager . listOperationsWithInputType ( type ) ; } else if ( relationship . toASCIIString ( ) . equals ( MSM . hasOutput . getURI ( ) ) ) { entities = this . serviceManager . listOperationsWithOutputType ( type ) ; } } return entities ; }
Generic implementation for finding all the Services or Operations that have one specific type as input or output .