Class: CpOraclecloud::JavaComponent
- Inherits:
-
CloudComponent
- Object
- CloudComponent
- CpOraclecloud::JavaComponent
- Includes:
- JavaMixin
- Defined in:
- app/models/cp_oraclecloud/java_component.rb
Instance Method Summary collapse
- #admin_password_complexity ⇒ Object
- #domain_partition_correct ⇒ Object
- #init ⇒ Object
- #instance_name ⇒ Object
- #instance_type ⇒ Object
- #pretty_size ⇒ Object
- #pretty_type ⇒ Object
- #server_count_correct ⇒ Object
Methods included from JavaMixin
Instance Method Details
#admin_password_complexity ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'app/models/cp_oraclecloud/java_component.rb', line 46 def admin_password_complexity if admin_password.size < 8 or admin_password.size > 30 errors.add :admin_password, "Must be at betweeen 8 and 30 characters long." end if !(admin_password[0] =~ /[[:alpha:]]/) errors.add :admin_password, "First character must be a letter" end if (admin_password =~ /[a-z]/).blank? then errors.add :admin_password, 'Must contain a lower case letter' end if (admin_password =~ /[A-Z]/).blank? then errors.add :admin_password, 'Must contain an upper case letter' end if (admin_password =~ /[0-9]/).blank? then errors.add :admin_password, 'Must contain atleast one number' end if (admin_password =~ /[-_#$]/).blank? then errors.add :admin_password, 'Must contain a special character (-, _, #, $)' end end |
#domain_partition_correct ⇒ Object
42 43 44 |
# File 'app/models/cp_oraclecloud/java_component.rb', line 42 def domain_partition_correct if ![0,1,2,4].include?(domain_partition_count.to_i) then errors.add :domain_partition_count, "Invalid Domain Partition Count" end end |
#init ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'app/models/cp_oraclecloud/java_component.rb', line 29 def init self.enable_admin_console ||= true self.provision_otd ||= true self.level ||= 'PAAS' self.subscription_type ||= 'HOURLY' self.edition ||= 'EE' self.num_nodes ||= 1 end |
#instance_name ⇒ Object
74 75 76 |
# File 'app/models/cp_oraclecloud/java_component.rb', line 74 def instance_name "service_name" end |
#instance_type ⇒ Object
70 71 72 |
# File 'app/models/cp_oraclecloud/java_component.rb', line 70 def instance_type "CpOraclecloud::JavaInstance" end |
#pretty_size ⇒ Object
64 65 66 67 68 |
# File 'app/models/cp_oraclecloud/java_component.rb', line 64 def pretty_size if config && config.is_a?(Hash) && config.key?('shape') config['shape'] end end |
#pretty_type ⇒ Object
60 61 62 |
# File 'app/models/cp_oraclecloud/java_component.rb', line 60 def pretty_type 'Oracle Java Cloud Service' end |
#server_count_correct ⇒ Object
38 39 40 |
# File 'app/models/cp_oraclecloud/java_component.rb', line 38 def server_count_correct if ![1,2,4,8].include?(num_nodes.to_i) then errors.add :num_nodes, "Invalid server count" end end |