use of java.text.ParseException in project Openfire by igniterealtime.
the class ConferenceManager method getConference.
public static ConferenceManager getConference(String conferenceId, String mediaPreference, String displayName, boolean permanent) {
ConferenceManager conferenceManager;
try {
conferenceManager = findConferenceManager(conferenceId);
if (Logger.logLevel >= Logger.LOG_INFO) {
Logger.println("found existing conference: '" + conferenceId + "'");
}
return conferenceManager;
} catch (ParseException e) {
}
try {
conferenceManager = new ConferenceManager(conferenceId, mediaPreference, displayName);
} catch (SocketException e) {
Logger.error("Can't create conference " + conferenceId + " " + e.getMessage());
return null;
}
synchronized (conferenceList) {
conferenceList.add(conferenceManager);
}
Logger.println("starting new conference: '" + conferenceId + "'. " + " conferences in progress: " + conferenceList.size());
conferenceManager.setPermanent(permanent);
String id = conferenceManager.getId();
if (displayName != null) {
id += ":" + mediaPreference + ":" + displayName;
}
ConferenceManager.conferenceEventNotification(new ConferenceEvent(ConferenceEvent.CONFERENCE_STARTED, id));
return conferenceManager;
}
use of java.text.ParseException in project Openfire by igniterealtime.
the class ConferenceManager method end.
private void end() {
try {
recordConference(false, null, null);
} catch (ParseException e) {
Logger.println(conferenceId + ": Failed to stop recording conference! " + e.getMessage());
}
Logger.writeFile("ending conf " + conferenceId + ": permanent " + permanent + ", mediaPreference " + mediaPreference);
if (permanent) {
conferenceSender.printStatistics();
if (mediaPreference != null) {
try {
setMediaInfo(mediaPreference);
} catch (ParseException e) {
Logger.println(conferenceId + ": Can't change meeting media setting to " + mediaPreference + ": " + e.getMessage());
}
mediaPreference = null;
}
} else {
if (done) {
return;
}
done = true;
ConferenceManager.conferenceEventNotification(new ConferenceEvent(ConferenceEvent.CONFERENCE_ENDED, conferenceId));
synchronized (conferenceList) {
conferenceList.remove(this);
}
if (conferenceReceiver != loneConferenceReceiver) {
conferenceReceiver.end();
}
conferenceSender.printStatistics();
}
int activeConferences = 0;
synchronized (conferenceList) {
for (int i = 0; i < conferenceList.size(); i++) {
ConferenceManager conferenceManager = (ConferenceManager) conferenceList.get(i);
if (conferenceManager.getMemberList().size() > 0) {
activeConferences++;
}
}
}
Logger.println("");
Logger.println("Conference: '" + conferenceId + "' has ended. " + "conferences still in progress: " + activeConferences);
Logger.println("");
Logger.flush();
if (totalMembers == 0) {
/*
* This is a great time to do a full garbage collection
*/
Logger.println("No conferences in progress, doing a full GC...");
System.gc();
}
}
use of java.text.ParseException in project Openfire by igniterealtime.
the class ConferenceManager method playTreatment.
/**
* Play a treatment to the specified conference
*/
public static void playTreatment(String conferenceId, String treatment) throws ParseException {
if (Logger.logLevel >= Logger.LOG_MOREINFO) {
Logger.println("playing treatment " + treatment + " to " + conferenceId);
}
synchronized (conferenceList) {
ConferenceManager conferenceManager;
conferenceManager = findConferenceManager(conferenceId);
try {
conferenceManager.addTreatment(treatment);
} catch (IOException e) {
throw new ParseException("bad treatment " + " " + e.getMessage(), 0);
}
return;
}
}
use of java.text.ParseException in project Openfire by igniterealtime.
the class ConferenceMember method addCall.
public void addCall(String whisperGroupId) throws ParseException {
synchronized (conferenceManager) {
synchronized (whisperGroups) {
WhisperGroup whisperGroup = wgManager.findWhisperGroup(whisperGroupId);
if (whisperGroup == null) {
Logger.println("Call " + cp + " Whisper group " + whisperGroupId + " doesn't exist. " + "Automatically creating it with attenuation 0 " + "and locked");
try {
whisperGroup = conferenceManager.createWhisperGroup(whisperGroupId, 0.0D);
whisperGroup.setTransient(true);
whisperGroup.setLocked(true);
} catch (ParseException e) {
Logger.println("Can't create whisper group " + whisperGroupId + " " + e.getMessage());
throw new ParseException("Can't create whisper group " + whisperGroupId + " " + e.getMessage(), 0);
}
}
addCall(whisperGroup);
}
}
}
use of java.text.ParseException in project Openfire by igniterealtime.
the class NSOutgoingCallAgent method initiateCall.
public void initiateCall() throws IOException {
InetSocketAddress isa = callHandler.getReceiveAddress();
if (isa == null) {
throw new IOException("can't get receiver socket!");
}
setState(CallState.INVITED);
TreatmentManager treatmentManager = null;
if (cp.getInputTreatment() != null) {
if (cp.getInputTreatment().length() > 0) {
try {
/*
* Just make sure we can open the file
*/
treatmentManager = new TreatmentManager(cp.getInputTreatment(), RtpPacket.PCM_ENCODING, mixerMediaPreference.getSampleRate(), mixerMediaPreference.getChannels());
treatmentManager.stopTreatment(false);
} catch (IOException e) {
Logger.println("Invalid input treatment: " + cp.getInputTreatment());
throw new IOException("Invalid input treatment: " + cp.getInputTreatment());
}
}
/*
* This is a special call which is used to play
* an input treatment as its input.
* There is no remote endpoint.
*/
try {
setRemoteMediaInfo(treatmentManager);
} catch (ParseException e) {
throw new IOException(e.getMessage());
}
}
}
Aggregations