ResourceDescription.pm 2.09 KB
Newer Older
Leo Gordon's avatar
Leo Gordon committed
1 2 3 4
=pod 

=head1 NAME

5
    Bio::EnsEMBL::Hive::ResourceDescription
Leo Gordon's avatar
Leo Gordon committed
6 7 8

=head1 DESCRIPTION

9
    A data container object (the only methods are getters/setters) that corresponds to a row in 'resource_description' table
Leo Gordon's avatar
Leo Gordon committed
10

11 12
=head1 LICENSE

13
    Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
nwillhoft's avatar
nwillhoft committed
14
    Copyright [2016-2021] EMBL-European Bioinformatics Institute
15 16 17 18 19 20 21 22 23 24

    Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software distributed under the License
    is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and limitations under the License.

Leo Gordon's avatar
Leo Gordon committed
25 26
=head1 CONTACT

27
    Please subscribe to the Hive mailing list:  http://listserver.ebi.ac.uk/mailman/listinfo/ehive-users  to discuss Hive-related questions or to be notified of our updates
Leo Gordon's avatar
Leo Gordon committed
28 29 30

=cut

31

Leo Gordon's avatar
Leo Gordon committed
32 33 34
package Bio::EnsEMBL::Hive::ResourceDescription;

use strict;
35
use warnings;
Leo Gordon's avatar
Leo Gordon committed
36

37
use base ( 'Bio::EnsEMBL::Hive::Storable' );
Leo Gordon's avatar
Leo Gordon committed
38

39

40 41 42 43 44
sub unikey {    # override the default from Cacheable parent
    return [ 'resource_class', 'meadow_type' ];
}


45
=head1 AUTOLOADED
Leo Gordon's avatar
Leo Gordon committed
46

47 48 49
    resource_class_id / resource_class

=cut
Leo Gordon's avatar
Leo Gordon committed
50

51

Leo Gordon's avatar
Leo Gordon committed
52 53 54 55 56 57 58 59 60
sub meadow_type {
    my $self = shift @_;

    if(@_) {
        $self->{'_meadow_type'} = shift @_;
    }
    return $self->{'_meadow_type'};
}

61 62

sub submission_cmd_args {
Leo Gordon's avatar
Leo Gordon committed
63 64 65
    my $self = shift @_;

    if(@_) {
66
        $self->{'_submission_cmd_args'} = shift @_;
Leo Gordon's avatar
Leo Gordon committed
67
    }
68
    return $self->{'_submission_cmd_args'} || '';
Leo Gordon's avatar
Leo Gordon committed
69 70
}

71 72 73 74 75 76 77 78 79 80 81

sub worker_cmd_args {
    my $self = shift @_;

    if(@_) {
        $self->{'_worker_cmd_args'} = shift @_;
    }
    return $self->{'_worker_cmd_args'} || '';
}


82
sub toString {
Leo Gordon's avatar
Leo Gordon committed
83 84
    my $self = shift @_;

85
    return 'ResourceDescription: ('.$self->resource_class->name.', '.$self->meadow_type.')->("'.$self->submission_cmd_args.'", "'.$self->worker_cmd_args.'")';
Leo Gordon's avatar
Leo Gordon committed
86 87 88 89
}

1;