From: Roland Haeder Date: Sat, 10 Oct 2015 20:06:05 +0000 (+0200) Subject: initial import X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5aef3d079fe67a26fb97672ea2d53018aafbb0f6;p=jphone-core.git initial import --- 5aef3d079fe67a26fb97672ea2d53018aafbb0f6 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0383bcc --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +/nbproject/private/ +/nbproject/*~ +/manifest.mf +/build/ +/dist/ +/data/* +/*.properties diff --git a/build.xml b/build.xml new file mode 100644 index 0000000..75f31a5 --- /dev/null +++ b/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project jphone-core. + + + diff --git a/dist.sh b/dist.sh new file mode 100755 index 0000000..f48251e --- /dev/null +++ b/dist.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +NAME="${PWD##*/}" +DIST="dist/${NAME}.jar" +LIST=`find ../*/lib/${NAME}.jar` +LIST="${LIST} `find ../*/*-ejb/lib/${NAME}.jar`" +LIST="${LIST} ${HOME}/gf_domains/domain1/lib/" + +for target in ${LIST}; +do + if [ ! -f "${DIST}" ] + then + echo "$0: '${DIST}' not found." + elif [ -d "${target}" ] + then + cp -v "${DIST}" "${target}" + elif [ -f "${target}" ] + then + cp -v "${DIST}" "${target}" + else + echo "$0: Target '${target}' not found." + fi +done diff --git a/lib/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar b/lib/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar new file mode 100644 index 0000000..2cc00f0 Binary files /dev/null and b/lib/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar differ diff --git a/lib/jcountry-core.jar b/lib/jcountry-core.jar new file mode 100644 index 0000000..ed08999 Binary files /dev/null and b/lib/jcountry-core.jar differ diff --git a/lib/jpa20-persistence/javax.persistence-2.1.0-doc.zip b/lib/jpa20-persistence/javax.persistence-2.1.0-doc.zip new file mode 100644 index 0000000..fd55e6e Binary files /dev/null and b/lib/jpa20-persistence/javax.persistence-2.1.0-doc.zip differ diff --git a/lib/jpa20-persistence/javax.persistence_2.1.0.v201304241213.jar b/lib/jpa20-persistence/javax.persistence_2.1.0.v201304241213.jar new file mode 100644 index 0000000..a4dd386 Binary files /dev/null and b/lib/jpa20-persistence/javax.persistence_2.1.0.v201304241213.jar differ diff --git a/lib/nblibraries.properties b/lib/nblibraries.properties new file mode 100644 index 0000000..7ee5412 --- /dev/null +++ b/lib/nblibraries.properties @@ -0,0 +1,10 @@ +libs.CopyLibs.classpath=\ + ${base}/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar +libs.CopyLibs.displayName=CopyLibs Task +libs.CopyLibs.prop-version=2.0 +libs.jpa20-persistence.classpath=\ + ${base}/jpa20-persistence/javax.persistence_2.1.0.v201304241213.jar +libs.jpa20-persistence.displayName=Persistence (JPA 2.1) +libs.jpa20-persistence.javadoc=\ + ${base}/jpa20-persistence/javax.persistence-2.1.0-doc.zip +libs.jpa20-persistence.prop-maven-dependencies=org.eclipse.persistence:javax.persistence:2.1.0:jar diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml new file mode 100644 index 0000000..2833aef --- /dev/null +++ b/nbproject/build-impl.xml @@ -0,0 +1,1438 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set test.src.dir + Must set build.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.test.classes.dir + Must set build.test.results.dir + Must set build.classes.excludes + Must set dist.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + No tests executed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set JVM to use for profiling in profiler.info.jvm + Must set profiler agent JVM arguments in profiler.info.jvmargs.agent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + To run this application from the command line without Ant, try: + + java -jar "${dist.jar.resolved}" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + Must select one file in the IDE or set debug.class + + + + + Must set fix.includes + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + Must select one file in the IDE or set profile.class + This target only works when run from inside the NetBeans IDE. + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + + + Must select some files in the IDE or set test.includes + + + + + Must select one file in the IDE or set run.class + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + Must select some files in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + Must select one file in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + + + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties new file mode 100644 index 0000000..b960a17 --- /dev/null +++ b/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=2bd33ca3 +build.xml.script.CRC32=2a7119fa +build.xml.stylesheet.CRC32=8064a381@1.75.2.48 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=2bd33ca3 +nbproject/build-impl.xml.script.CRC32=79098c61 +nbproject/build-impl.xml.stylesheet.CRC32=876e7a8f@1.75.2.48 diff --git a/nbproject/project.properties b/nbproject/project.properties new file mode 100644 index 0000000..baf13af --- /dev/null +++ b/nbproject/project.properties @@ -0,0 +1,94 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=true +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +application.title=jphone-core +application.vendor=Roland Haeder +auxiliary.org-netbeans-spi-editor-hints-projects.perProjectHintSettingsFile=nbproject/cfg_hints.xml +build.classes.dir=${build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +# This directory is removed when the project is cleaned: +build.dir=build +build.generated.dir=${build.dir}/generated +build.generated.sources.dir=${build.dir}/generated-sources +# Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +# Uncomment to specify the preferred debugger connection transport: +#debug.transport=dt_socket +debug.classpath=\ + ${run.classpath} +debug.test.classpath=\ + ${run.test.classpath} +# Files in build.classes.dir which should be excluded from distribution jar +dist.archive.excludes= +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/jphone-core.jar +dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= +excludes= +file.reference.jcountry-core.jar=lib/jcountry-core.jar +includes=** +jar.archive.disabled=${jnlp.enabled} +jar.compress=false +jar.index=${jnlp.enabled} +javac.classpath=\ + ${file.reference.jcountry-core.jar}:\ + ${libs.jpa20-persistence.classpath} +# Space-separated list of extra javac options +javac.compilerargs=-Xlint:unchecked -Xlint:deprecation +javac.deprecation=true +javac.processorpath=\ + ${javac.classpath} +javac.source=1.7 +javac.target=1.7 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=true +javadoc.encoding=${source.encoding} +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=true +javadoc.splitindex=true +javadoc.use=true +javadoc.version=true +javadoc.windowtitle=Phone Library +jnlp.codebase.type=no.codebase +jnlp.descriptor=application +jnlp.enabled=false +jnlp.mixed.code=default +jnlp.offline-allowed=false +jnlp.signed=false +jnlp.signing= +jnlp.signing.alias= +jnlp.signing.keystore= +# Optional override of default Codebase manifest attribute, use to prevent RIAs from being repurposed +manifest.custom.codebase= +# Optional override of default Permissions manifest attribute (supported values: sandbox, all-permissions) +manifest.custom.permissions= +meta.inf.dir=${src.dir}/META-INF +mkdist.disabled=true +platform.active=default_platform +project.license=gpl30 +run.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +# Space-separated list of JVM arguments used when running the project. +# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. +# To set system properties for unit tests define test-sys-prop.name=value: +run.jvmargs= +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +source.encoding=UTF-8 +source.reference.jcountry-core.jar=../jcountry-core/src/ +src.dir=src +test.src.dir=test diff --git a/nbproject/project.xml b/nbproject/project.xml new file mode 100644 index 0000000..e0f88c5 --- /dev/null +++ b/nbproject/project.xml @@ -0,0 +1,18 @@ + + + org.netbeans.modules.java.j2seproject + + + jphone-core + + + + + + + + + ./lib/nblibraries.properties + + + diff --git a/src/org/mxchange/jphone/phonenumbers/DialableNumber.java b/src/org/mxchange/jphone/phonenumbers/DialableNumber.java new file mode 100644 index 0000000..e7393cd --- /dev/null +++ b/src/org/mxchange/jphone/phonenumbers/DialableNumber.java @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2015 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.jphone.phonenumbers; + +import java.io.Serializable; + +/** + * A POJO for dialable numbers + *

+ * @author Roland Haeder + */ +public interface DialableNumber extends Serializable { + + /** + * Getter for id number + *

+ * @return Id number + */ + public Long getPhoneId (); + + /** + * Setter for id number + *

+ * @param phoneId Id number + */ + public void setPhoneId (final Long phoneId); + + /** + * Getter for dial number without prefix + *

+ * @return Dial number without prefix + */ + public Long getPhoneNumber (); + + /** + * Setter for dial number without prefix + *

+ * @param phoneNumber Dial number without prefix + */ + public void setPhoneNumber (final Long phoneNumber); + + /** + * Getter for area code without dial prefix (example: 2151 for Krefeld) + *

+ * @return Area code without dial prefix + */ + public Integer getPhoneAreaCode (); + + /** + * Setter for area code without dial prefix (example: 2151 for Krefeld) + *

+ * @param phoneAreaCode Area code without dial prefix + */ + public void setPhoneAreaCode (final Integer phoneAreaCode); +} diff --git a/src/org/mxchange/jphone/phonenumbers/cellphone/CellphoneNumber.java b/src/org/mxchange/jphone/phonenumbers/cellphone/CellphoneNumber.java new file mode 100644 index 0000000..691b4b3 --- /dev/null +++ b/src/org/mxchange/jphone/phonenumbers/cellphone/CellphoneNumber.java @@ -0,0 +1,112 @@ +/* + * Copyright (C) 2015 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.jphone.phonenumbers.cellphone; + +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.OneToOne; +import javax.persistence.Table; +import org.mxchange.jphone.phonenumbers.smsprovider.CellphoneProvider; +import org.mxchange.jphone.phonenumbers.smsprovider.SmsProvider; + +/** + * A POJO for dialable cellphone numbers + *

+ * @author Roland Haeder + */ +@Entity (name = "cellphone_numbers") +@Table (name = "cellphone_numbers") +public class CellphoneNumber implements DialableCellphoneNumber, Comparable { + + /** + * Serial number + */ + private static final long serialVersionUID = 13_859_879_482_106L; + + /** + * Id number + */ + @Id + @GeneratedValue (strategy = GenerationType.IDENTITY) + @Column (name = "cellphone_id", length = 20, updatable = false, nullable = false) + private Long phoneId; + + /** + * Connection to table "cellphone_provider" (for dial prefix and more data) + */ + @JoinColumn (name = "cellphone_provider_id", nullable = false) + @OneToOne (targetEntity = CellphoneProvider.class, cascade = CascadeType.ALL, optional = false) + private SmsProvider cellphoneProvider; + + /** + * Number without prefix to dial + */ + @Basic (optional = false) + @Column (name = "cellphone_number", length = 20, nullable = false) + private Long phoneNumber; + + @Override + public Long getPhoneId () { + return this.phoneId; + } + + @Override + public void setPhoneId (final Long phoneId) { + this.phoneId = phoneId; + } + + @Override + public SmsProvider getCellphoneProvider () { + return this.cellphoneProvider; + } + + @Override + public void setCellphoneProvider (final SmsProvider cellphoneProvider) { + this.cellphoneProvider = cellphoneProvider; + } + + @Override + public Long getPhoneNumber () { + return this.phoneNumber; + } + + @Override + public void setPhoneNumber (final Long phoneNumber) { + this.phoneNumber = phoneNumber; + } + + @Override + public Integer getPhoneAreaCode () { + throw new UnsupportedOperationException("Cellphone numbers don't have area codes. Please fix your code."); //NOI18N + } + + @Override + public void setPhoneAreaCode (final Integer phoneAreaCode) { + throw new UnsupportedOperationException("Cellphone numbers don't have area codes. Please fix your code."); //NOI18N + } + + @Override + public int compareTo (final DialableCellphoneNumber dialableCellphoneNumber) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } +} diff --git a/src/org/mxchange/jphone/phonenumbers/cellphone/DialableCellphoneNumber.java b/src/org/mxchange/jphone/phonenumbers/cellphone/DialableCellphoneNumber.java new file mode 100644 index 0000000..5fed971 --- /dev/null +++ b/src/org/mxchange/jphone/phonenumbers/cellphone/DialableCellphoneNumber.java @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2015 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.jphone.phonenumbers.cellphone; + +import org.mxchange.jphone.phonenumbers.DialableNumber; +import org.mxchange.jphone.phonenumbers.smsprovider.SmsProvider; + +/** + * A POJO for dialable cellphone numbers with carriers. + *

+ * @author Roland Haeder + */ +public interface DialableCellphoneNumber extends DialableNumber { + + /** + * Getter for SMS provider instance + *

+ * @return SMS provider instance + */ + public SmsProvider getCellphoneProvider (); + + /** + * Setter for SMS provider instance + *

+ * @param cellphoneProvider SMS provider instance + */ + public void setCellphoneProvider (final SmsProvider cellphoneProvider); +} diff --git a/src/org/mxchange/jphone/phonenumbers/fax/DialableFaxNumber.java b/src/org/mxchange/jphone/phonenumbers/fax/DialableFaxNumber.java new file mode 100644 index 0000000..4e904e3 --- /dev/null +++ b/src/org/mxchange/jphone/phonenumbers/fax/DialableFaxNumber.java @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2015 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.jphone.phonenumbers.fax; + +import org.mxchange.jphone.phonenumbers.DialableNumber; + +/** + * A POJI for dialable fax numbers + *

+ * @author Roland Haeder + */ +public interface DialableFaxNumber extends DialableNumber { +} diff --git a/src/org/mxchange/jphone/phonenumbers/fax/FaxNumber.java b/src/org/mxchange/jphone/phonenumbers/fax/FaxNumber.java new file mode 100644 index 0000000..c1d5bdd --- /dev/null +++ b/src/org/mxchange/jphone/phonenumbers/fax/FaxNumber.java @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2015 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.jphone.phonenumbers.fax; + +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Table; + +/** + * A POJO for dialable fax numbers + *

+ * @author Roland Haeder + */ +@Entity (name = "fax_numbers") +@Table (name = "fax_numbers") +public class FaxNumber implements DialableFaxNumber, Comparable { + + /** + * Serial number + */ + private static final long serialVersionUID = 17_687_687_191_375L; + + /** + * Id number + */ + @Id + @GeneratedValue + @Column (name = "fax_id", length = 20, nullable = false, updatable = false) + private Long phoneId; + + /** + * Fax number without prefix + */ + @Basic (optional = false) + @Column (name = "fax_number", length = 20, nullable = false) + private Long phoneNumber; + + /** + * Area code (example: 2151 for Krefeld) + */ + @Basic (optional = false) + @Column (name = "fax_area_code", length = 10, nullable = false) + private Integer phoneAreaCode; + + @Override + public Long getPhoneId () { + return this.phoneId; + } + + @Override + public void setPhoneId (final Long phoneId) { + this.phoneId = phoneId; + } + + @Override + public Long getPhoneNumber () { + return this.phoneNumber; + } + + @Override + public void setPhoneNumber (final Long phoneNumber) { + this.phoneNumber = phoneNumber; + } + + @Override + public int compareTo (final DialableFaxNumber dialableFaxNumber) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + @Override + public Integer getPhoneAreaCode () { + return this.phoneAreaCode; + } + + @Override + public void setPhoneAreaCode (final Integer phoneAreaCode) { + this.phoneAreaCode = phoneAreaCode; + } + +} diff --git a/src/org/mxchange/jphone/phonenumbers/landline/DialableLandLineNumber.java b/src/org/mxchange/jphone/phonenumbers/landline/DialableLandLineNumber.java new file mode 100644 index 0000000..6d45894 --- /dev/null +++ b/src/org/mxchange/jphone/phonenumbers/landline/DialableLandLineNumber.java @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2015 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.jphone.phonenumbers.landline; + +import org.mxchange.jphone.phonenumbers.DialableNumber; + +/** + * A POJI for dialable land-line numbers + * @author Roland Haeder + */ +public interface DialableLandLineNumber extends DialableNumber { +} diff --git a/src/org/mxchange/jphone/phonenumbers/landline/LandLineNumber.java b/src/org/mxchange/jphone/phonenumbers/landline/LandLineNumber.java new file mode 100644 index 0000000..d1b265e --- /dev/null +++ b/src/org/mxchange/jphone/phonenumbers/landline/LandLineNumber.java @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2015 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.jphone.phonenumbers.landline; + +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.OneToOne; +import javax.persistence.Table; +import org.mxchange.jcountry.data.Country; +import org.mxchange.jcountry.data.CountryData; + +/** + * A POJO for dialable phone numbers + *

+ * @author Roland Haeder + */ +@Entity (name = "phone_numbers") +@Table (name = "phone_numbers") +public class LandLineNumber implements DialableLandLineNumber, Comparable { + + /** + * Serial number + */ + private static final long serialVersionUID = 18_563_748_781_956L; + + /** + * Id number + */ + @Id + @GeneratedValue (strategy = GenerationType.IDENTITY) + @Column (name = "phone_id", length = 10, nullable = false, updatable = false) + private Long phoneId; + + /** + * Phone number with out dial prefix + */ + @Basic (optional = false) + @Column (name = "phone_number", length = 20, nullable = false) + private Long phoneNumber; + + /** + * Area code (example: 2151 for Krefeld) + */ + @Basic (optional = false) + @Column (name = "phone_area_code", length = 10, nullable = false) + private Integer phoneAreaCode; + + /** + * Connection to table "country_data" + */ + @JoinColumn(name = "phone_country_id", nullable = false, updatable = false) + @OneToOne(targetEntity = CountryData.class, cascade = CascadeType.ALL, optional = false) + private Country phoneCountry; + + @Override + public Long getPhoneId () { + return this.phoneId; + } + + @Override + public void setPhoneId (final Long phoneId) { + this.phoneId = phoneId; + } + + @Override + public Long getPhoneNumber () { + return this.phoneNumber; + } + + @Override + public void setPhoneNumber (final Long phoneNumber) { + this.phoneNumber = phoneNumber; + } + + @Override + public Integer getPhoneAreaCode () { + return this.phoneAreaCode; + } + + @Override + public void setPhoneAreaCode (final Integer phoneAreaCode) { + this.phoneAreaCode = phoneAreaCode; + } + + @Override + public int compareTo (final DialableLandLineNumber dialableNumber) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } +} diff --git a/src/org/mxchange/jphone/phonenumbers/smsprovider/CellphoneProvider.java b/src/org/mxchange/jphone/phonenumbers/smsprovider/CellphoneProvider.java new file mode 100644 index 0000000..30891f6 --- /dev/null +++ b/src/org/mxchange/jphone/phonenumbers/smsprovider/CellphoneProvider.java @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2015 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.jphone.phonenumbers.smsprovider; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Table; + +/** + * A POJO for cellphone providers + *

+ * @author Roland Haeder + */ +@Entity (name = "cellphone_provider") +@Table (name = "cellphone_provider") +public class CellphoneProvider implements SmsProvider { + + /** + * Serial number + */ + private static final long serialVersionUID = 185_878_567_810_590L; + + /** + * Id number + */ + @Id + @GeneratedValue + @Column(name = "provider_id", length = 20, nullable = false, updatable = false) + private Long providerId; + + /** + * Provider dial prefix (example: 0177 for German E+) + */ + private Long providerDialPrefix; + + /** + * Name of the provider + */ + private String providerName; + + @Override + public Long getProviderId () { + return providerId; + } + + @Override + public void setProviderId (final Long providerId) { + this.providerId = providerId; + } + + @Override + public Long getProviderDialPrefix () { + return providerDialPrefix; + } + + @Override + public void setProviderDialPrefix (final Long providerDialPrefix) { + this.providerDialPrefix = providerDialPrefix; + } + + @Override + public String getProviderName () { + return providerName; + } + + @Override + public void setProviderName (final String providerName) { + this.providerName = providerName; + } + +} diff --git a/src/org/mxchange/jphone/phonenumbers/smsprovider/SmsProvider.java b/src/org/mxchange/jphone/phonenumbers/smsprovider/SmsProvider.java new file mode 100644 index 0000000..557057d --- /dev/null +++ b/src/org/mxchange/jphone/phonenumbers/smsprovider/SmsProvider.java @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2015 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.jphone.phonenumbers.smsprovider; + +import java.io.Serializable; + +/** + * A POJO for SMS provider + *

+ * @author Roland Haeder + */ +public interface SmsProvider extends Serializable { + + /** + * Getter for id number + *

+ * @return Id number + */ + public Long getProviderId (); + + /** + * Setter for id number + *

+ * @param providerId Id number + */ + public void setProviderId (final Long providerId); + + /** + * Getter for provider dial prefix + *

+ * @return Provider dial prefix + */ + public Long getProviderDialPrefix (); + + /** + * Setter for provider dial prefix + *

+ * @param providerDialPrefix Provider dial prefix + */ + public void setProviderDialPrefix (final Long providerDialPrefix); + + /** + * Getter for provider name + *

+ * @return Provider name + */ + public String getProviderName (); + + /** + * Setter for provider name + *

+ * @param providerName Provider name + */ + public void setProviderName (final String providerName); +}