Skip to content
Snippets Groups Projects
Commit b7cfb04b authored by ismcarb's avatar ismcarb
Browse files

nombres de hosts

parent 356dd81e
No related branches found
No related tags found
No related merge requests found
...@@ -4,10 +4,15 @@ ...@@ -4,10 +4,15 @@
<option name="autoReloadType" value="SELECTIVE" /> <option name="autoReloadType" value="SELECTIVE" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="0c5e7f40-d6e0-4cdf-8175-c288dac24af5" name="Changes" comment="Cambios y covers"> <list default="true" id="0c5e7f40-d6e0-4cdf-8175-c288dac24af5" name="Changes" comment="ip's">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/spotify/media/Globals.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/spotify/media/Globals.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/spotify/media/Globals.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/spotify/media/Globals.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/spotify/rmi/client/stream/unit/ContinuousReadL.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/spotify/rmi/client/stream/unit/ContinuousReadL.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/spotify/rmi/client/stream/unit/PlayList.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/spotify/rmi/client/stream/unit/PlayList.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/spotify/rmi/client/stream/unit/PlayRandomSong.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/spotify/rmi/client/stream/unit/PlayRandomSong.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/spotify/rmi/client/stream/unit/PlaySong.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/spotify/rmi/client/stream/unit/PlaySong.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/spotify/rmi/client/stream/unit/PrimerasOperaciones.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/spotify/rmi/client/stream/unit/PrimerasOperaciones.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/spotify/rmi/client/stream/unit/PrimerasOperaciones.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/spotify/rmi/client/stream/unit/PrimerasOperaciones.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/spotify/rmi/client/stream/unit/SegundasOperaciones.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/spotify/rmi/client/stream/unit/SegundasOperaciones.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/spotify/rmi/server/Launcher.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/spotify/rmi/server/Launcher.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/spotify/rmi/server/Launcher.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/spotify/rmi/server/Launcher.java" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
...@@ -110,7 +115,7 @@ ...@@ -110,7 +115,7 @@
<workItem from="1716300799328" duration="6999000" /> <workItem from="1716300799328" duration="6999000" />
<workItem from="1716309405427" duration="3744000" /> <workItem from="1716309405427" duration="3744000" />
<workItem from="1716376204050" duration="3565000" /> <workItem from="1716376204050" duration="3565000" />
<workItem from="1716384955891" duration="5764000" /> <workItem from="1716384955891" duration="7003000" />
</task> </task>
<task id="LOCAL-00001" summary="l"> <task id="LOCAL-00001" summary="l">
<option name="closed" value="true" /> <option name="closed" value="true" />
...@@ -200,7 +205,15 @@ ...@@ -200,7 +205,15 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1716389438598</updated> <updated>1716389438598</updated>
</task> </task>
<option name="localTasksCounter" value="12" /> <task id="LOCAL-00012" summary="ip's">
<option name="closed" value="true" />
<created>1716390936981</created>
<option name="number" value="00012" />
<option name="presentableId" value="LOCAL-00012" />
<option name="project" value="LOCAL" />
<updated>1716390936981</updated>
</task>
<option name="localTasksCounter" value="13" />
<servers /> <servers />
</component> </component>
<component name="TypeScriptGeneratedFilesManager"> <component name="TypeScriptGeneratedFilesManager">
...@@ -229,6 +242,7 @@ ...@@ -229,6 +242,7 @@
<MESSAGE value="Las canciones" /> <MESSAGE value="Las canciones" />
<MESSAGE value="workspace" /> <MESSAGE value="workspace" />
<MESSAGE value="Cambios y covers" /> <MESSAGE value="Cambios y covers" />
<option name="LAST_COMMIT_MESSAGE" value="Cambios y covers" /> <MESSAGE value="ip's" />
<option name="LAST_COMMIT_MESSAGE" value="ip's" />
</component> </component>
</project> </project>
\ No newline at end of file
...@@ -23,7 +23,8 @@ public class Globals { ...@@ -23,7 +23,8 @@ public class Globals {
public static String log_stream = " [STREAM] Streaming to: "; public static String log_stream = " [STREAM] Streaming to: ";
public static String log_stream_end = " [STREAM] Stream finished. Tx Bytes: "; public static String log_stream_end = " [STREAM] Stream finished. Tx Bytes: ";
// Streaming paths // Streaming paths
public static String server_host = "192.168.43.57"; public static String server_host = "localHost";
public static String client_host = "localHost";
public static int server_port = 20099; public static int server_port = 20099;
public static String path_origin = "./mp3files/origin/"; public static String path_origin = "./mp3files/origin/";
public static String path_destination = "./mp3files/destination/"; public static String path_destination = "./mp3files/destination/";
......
package spotify.rmi.client.stream.unit; package spotify.rmi.client.stream.unit;
import spotify.media.Globals;
import spotify.rmi.common.Spotify; import spotify.rmi.common.Spotify;
import java.rmi.Naming; import java.rmi.Naming;
...@@ -7,14 +8,17 @@ import java.util.ArrayList; ...@@ -7,14 +8,17 @@ import java.util.ArrayList;
import java.util.Scanner; import java.util.Scanner;
import spotify.media.Media; import spotify.media.Media;
import spotify.rmi.common.SpotifyServer;
public class ContinuousReadL { public class ContinuousReadL {
public static void main(String [ ] args) { public static void main(String [ ] args) {
String host = "localHost";
Scanner scanner = new Scanner(System.in); Scanner scanner = new Scanner(System.in);
System.setProperty("java.rmi.server.hostname",Globals.client_host);
try { try {
Spotify or = (Spotify) Naming.lookup("rmi://"+host+"/ObjetoSpotify"); Spotify or = (Spotify) Naming.lookup("rmi://"+Globals.server_host+"/"+Globals.remote_name);
System.out.println(or.hello()); System.out.println(or.hello());
......
package spotify.rmi.client.stream.unit; package spotify.rmi.client.stream.unit;
import spotify.media.Globals;
import spotify.rmi.client.stream.SpotifyClientImpl; import spotify.rmi.client.stream.SpotifyClientImpl;
import spotify.rmi.common.Spotify; import spotify.rmi.common.Spotify;
import spotify.rmi.common.SpotifyServer; import spotify.rmi.common.SpotifyServer;
...@@ -10,13 +11,14 @@ import java.util.Scanner; ...@@ -10,13 +11,14 @@ import java.util.Scanner;
import spotify.media.Media; import spotify.media.Media;
public class PlayList { public class PlayList {
public static void main(String [ ] args) { public static void main(String [ ] args) {
String host = "localHost";
Scanner scanner = new Scanner(System.in); Scanner scanner = new Scanner(System.in);
System.setProperty("java.rmi.server.hostname",Globals.client_host);
try { try {
SpotifyServer orServer = (SpotifyServer) Naming.lookup("rmi://"+host+"/ObjetoSpotify"); SpotifyServer orServer = (SpotifyServer) Naming.lookup("rmi://"+ Globals.server_host+"/"+Globals.remote_name);
Spotify or = (Spotify) Naming.lookup("rmi://"+host+"/ObjetoSpotify"); Spotify or = (Spotify) Naming.lookup("rmi://"+Globals.server_host+"/"+Globals.remote_name);
System.out.println(or.hello()); System.out.println(or.hello());
......
package spotify.rmi.client.stream.unit; package spotify.rmi.client.stream.unit;
import spotify.media.Globals;
import spotify.media.Media; import spotify.media.Media;
import spotify.rmi.client.stream.SpotifyClientImpl; import spotify.rmi.client.stream.SpotifyClientImpl;
import spotify.rmi.common.Spotify; import spotify.rmi.common.Spotify;
...@@ -9,11 +10,12 @@ import java.rmi.Naming; ...@@ -9,11 +10,12 @@ import java.rmi.Naming;
public class PlayRandomSong { public class PlayRandomSong {
public static void main(String [ ] args) { public static void main(String [ ] args) {
String host = "localHost";
System.setProperty("java.rmi.server.hostname",Globals.client_host);
try { try {
SpotifyServer orServer = (SpotifyServer) Naming.lookup("rmi://"+host+"/ObjetoSpotify"); SpotifyServer orServer = (SpotifyServer) Naming.lookup("rmi://"+ Globals.server_host+"/"+Globals.remote_name);
Spotify or = (Spotify) Naming.lookup("rmi://"+host+"/ObjetoSpotify"); Spotify or = (Spotify) Naming.lookup("rmi://"+Globals.server_host+"/"+Globals.remote_name);
System.out.println(or.hello()); System.out.println(or.hello());
......
package spotify.rmi.client.stream.unit; package spotify.rmi.client.stream.unit;
import spotify.media.Globals;
import spotify.media.Media; import spotify.media.Media;
import spotify.rmi.common.*; import spotify.rmi.common.*;
import spotify.rmi.client.stream.SpotifyClientImpl; import spotify.rmi.client.stream.SpotifyClientImpl;
...@@ -10,12 +11,12 @@ import java.io.File; ...@@ -10,12 +11,12 @@ import java.io.File;
public class PlaySong { public class PlaySong {
public static void main(String [ ] args) { public static void main(String [ ] args) {
String host = "localHost";
//System.setProperty("java.rmi.server.hostname","ip"); System.setProperty("java.rmi.server.hostname",Globals.client_host);
try { try {
SpotifyServer orServer = (SpotifyServer) Naming.lookup("rmi://"+host+"/ObjetoSpotify"); SpotifyServer orServer = (SpotifyServer) Naming.lookup("rmi://"+ Globals.server_host+"/"+Globals.remote_name);
Spotify or = (Spotify) Naming.lookup("rmi://"+host+"/ObjetoSpotify"); Spotify or = (Spotify) Naming.lookup("rmi://"+Globals.server_host+"/"+Globals.remote_name);
String respuesta = or.auth("hector", "1234"); String respuesta = or.auth("hector", "1234");
System.out.println("[Respuesta: "+respuesta+"]"); System.out.println("[Respuesta: "+respuesta+"]");
......
package spotify.rmi.client.stream.unit; package spotify.rmi.client.stream.unit;
import spotify.media.Globals;
import spotify.media.Media; import spotify.media.Media;
import spotify.rmi.client.stream.SpotifyClientImpl; import spotify.rmi.client.stream.SpotifyClientImpl;
import spotify.rmi.common.Spotify; import spotify.rmi.common.Spotify;
...@@ -10,14 +11,14 @@ import java.util.Scanner; ...@@ -10,14 +11,14 @@ import java.util.Scanner;
public class PrimerasOperaciones { public class PrimerasOperaciones {
public static void main(String [ ] args) { public static void main(String [ ] args) {
String host = "localHost";
Scanner scanner = new Scanner(System.in); Scanner scanner = new Scanner(System.in);
System.setProperty("java.rmi.server.hostname","192.168.43.153"); System.setProperty("java.rmi.server.hostname",Globals.client_host);
try { try {
SpotifyServer orServer = (SpotifyServer) Naming.lookup("rmi://"+host+"/ObjetoSpotify"); SpotifyServer orServer = (SpotifyServer) Naming.lookup("rmi://"+Globals.server_host+"/"+Globals.remote_name);
Spotify or = (Spotify) Naming.lookup("rmi://"+host+"/ObjetoSpotify"); Spotify or = (Spotify) Naming.lookup("rmi://"+Globals.server_host+"/"+Globals.remote_name);
// Saludo // Saludo
String saludo = or.hello(); String saludo = or.hello();
......
package spotify.rmi.client.stream.unit; package spotify.rmi.client.stream.unit;
import java.util.Scanner; import java.util.Scanner;
import spotify.media.Globals;
import spotify.media.Media; import spotify.media.Media;
import spotify.rmi.client.stream.SpotifyClientImpl; import spotify.rmi.client.stream.SpotifyClientImpl;
import spotify.rmi.common.Spotify; import spotify.rmi.common.Spotify;
...@@ -10,13 +12,14 @@ import java.rmi.Naming; ...@@ -10,13 +12,14 @@ import java.rmi.Naming;
public class SegundasOperaciones { public class SegundasOperaciones {
public static void main(String [ ] args) { public static void main(String [ ] args) {
String host = "localHost";
Scanner scanner = new Scanner(System.in); Scanner scanner = new Scanner(System.in);
//System.setProperty("java.rmi.server.hostname","ip");
System.setProperty("java.rmi.server.hostname",Globals.client_host);
try { try {
SpotifyServer orServer = (SpotifyServer) Naming.lookup("rmi://"+host+"/ObjetoSpotify"); SpotifyServer orServer = (SpotifyServer) Naming.lookup("rmi://"+Globals.server_host+"/"+Globals.remote_name);
Spotify or = (Spotify) Naming.lookup("rmi://"+host+"/ObjetoSpotify"); Spotify or = (Spotify) Naming.lookup("rmi://"+Globals.server_host+"/"+Globals.remote_name);
//Saludo //Saludo
String saludo = or.hello(); String saludo = or.hello();
......
package spotify.rmi.server; package spotify.rmi.server;
import spotify.media.Globals;
import spotify.media.Media; import spotify.media.Media;
import spotify.rmi.server.utils.MultiMap; import spotify.rmi.server.utils.MultiMap;
...@@ -13,7 +14,7 @@ public class Launcher { ...@@ -13,7 +14,7 @@ public class Launcher {
public static void main(String [ ] args) { public static void main(String [ ] args) {
int PUERTO = 1099; // puerto de servicio int PUERTO = 1099; // puerto de servicio
System.setProperty("java.rmi.server.hostname","192.168.43.57"); System.setProperty("java.rmi.server.hostname",Globals.server_host);
// Mapa para almacenar información relacionada con las sesiones de los clientes // Mapa para almacenar información relacionada con las sesiones de los clientes
MultiMap<String, String> mapa = new MultiMap(); MultiMap<String, String> mapa = new MultiMap();
...@@ -79,7 +80,7 @@ public class Launcher { ...@@ -79,7 +80,7 @@ public class Launcher {
try { try {
SpotifyServerImpl oRemoto = new SpotifyServerImpl(mapa, datosLog, DIRECTORIO); SpotifyServerImpl oRemoto = new SpotifyServerImpl(mapa, datosLog, DIRECTORIO);
Registry registro = LocateRegistry.createRegistry(PUERTO); Registry registro = LocateRegistry.createRegistry(PUERTO);
registro.rebind("ObjetoSpotify", oRemoto); registro.rebind(Globals.remote_name, oRemoto);
System.err.println("Servidor preparado"); System.err.println("Servidor preparado");
} catch (Exception e) { } catch (Exception e) {
System.err.println("Excepción del servidor: "+e.toString()); System.err.println("Excepción del servidor: "+e.toString());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment