-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migrationo of Messages to new structure
- Loading branch information
Showing
13 changed files
with
315 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/main/groovy/org/cip4/tools/alces/service/jmfmessage/cip4/KnownDevicesMessageService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package org.cip4.tools.alces.service.jmfmessage.cip4; | ||
|
||
import org.cip4.jdflib.auto.JDFAutoDeviceFilter; | ||
import org.cip4.tools.alces.service.jmfmessage.IntegrationUtils; | ||
import org.cip4.tools.alces.service.jmfmessage.JmfMessageService; | ||
import org.springframework.stereotype.Service; | ||
|
||
@Service | ||
public class KnownDevicesMessageService implements JmfMessageService { | ||
|
||
@Override | ||
public String getMessageType() { | ||
return "KnownDevices"; | ||
} | ||
|
||
@Override | ||
public String getButtonTextExtension() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public String createJmfMessage(IntegrationUtils integrationUtils) { | ||
return integrationUtils.getJmfBuilder() | ||
.buildKnownDevicesQuery(JDFAutoDeviceFilter.EnumDeviceDetails.Details) | ||
.toXML(); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
...main/groovy/org/cip4/tools/alces/service/jmfmessage/cip4/KnownMessagesMessageService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package org.cip4.tools.alces.service.jmfmessage.cip4; | ||
|
||
import org.cip4.jdflib.auto.JDFAutoDeviceFilter; | ||
import org.cip4.tools.alces.service.jmfmessage.IntegrationUtils; | ||
import org.cip4.tools.alces.service.jmfmessage.JmfMessageService; | ||
import org.springframework.stereotype.Service; | ||
|
||
@Service | ||
public class KnownMessagesMessageService implements JmfMessageService { | ||
|
||
@Override | ||
public String getMessageType() { | ||
return "KnownMessages"; | ||
} | ||
|
||
@Override | ||
public String getButtonTextExtension() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public String createJmfMessage(IntegrationUtils integrationUtils) { | ||
return integrationUtils.getJmfBuilder() | ||
.buildKnownMessagesQuery() | ||
.toXML(); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...groovy/org/cip4/tools/alces/service/jmfmessage/cip4/KnownSubscriptionsMessageService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package org.cip4.tools.alces.service.jmfmessage.cip4; | ||
|
||
import org.cip4.tools.alces.service.jmfmessage.IntegrationUtils; | ||
import org.cip4.tools.alces.service.jmfmessage.JmfMessageService; | ||
import org.springframework.stereotype.Service; | ||
|
||
@Service | ||
public class KnownSubscriptionsMessageService implements JmfMessageService { | ||
|
||
@Override | ||
public String getMessageType() { | ||
return "KnownSubscriptions"; | ||
} | ||
|
||
@Override | ||
public String getButtonTextExtension() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public String createJmfMessage(IntegrationUtils integrationUtils) { | ||
return integrationUtils.getJmfBuilder() | ||
.buildKnownSubscriptionsQuery(null, null) | ||
.toXML(); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/main/groovy/org/cip4/tools/alces/service/jmfmessage/cip4/QueueStatusMessageService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package org.cip4.tools.alces.service.jmfmessage.cip4; | ||
|
||
import org.cip4.tools.alces.service.jmfmessage.IntegrationUtils; | ||
import org.cip4.tools.alces.service.jmfmessage.JmfMessageService; | ||
import org.springframework.stereotype.Service; | ||
|
||
@Service | ||
public class QueueStatusMessageService implements JmfMessageService { | ||
|
||
@Override | ||
public String getMessageType() { | ||
return "QueueStatus"; | ||
} | ||
|
||
@Override | ||
public String getButtonTextExtension() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public String createJmfMessage(IntegrationUtils integrationUtils) { | ||
return integrationUtils.getJmfBuilder() | ||
.buildQueueStatus() | ||
.toXML(); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...y/org/cip4/tools/alces/service/jmfmessage/cip4/QueueStatusSubscriptionMessageService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package org.cip4.tools.alces.service.jmfmessage.cip4; | ||
|
||
import org.cip4.tools.alces.service.jmfmessage.IntegrationUtils; | ||
import org.cip4.tools.alces.service.jmfmessage.JmfMessageService; | ||
import org.springframework.stereotype.Service; | ||
|
||
@Service | ||
public class QueueStatusSubscriptionMessageService implements JmfMessageService { | ||
|
||
@Override | ||
public String getMessageType() { | ||
return "QueueStatus"; | ||
} | ||
|
||
@Override | ||
public String getButtonTextExtension() { | ||
return "Subscription"; | ||
} | ||
|
||
@Override | ||
public String createJmfMessage(IntegrationUtils integrationUtils) { | ||
return integrationUtils.getJmfBuilder() | ||
.buildQueueStatusSubscription(integrationUtils.getSubscriberUrl()) | ||
.toXML(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...groovy/org/cip4/tools/alces/service/jmfmessage/cip4/ResubmitQueueEntryMessageService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package org.cip4.tools.alces.service.jmfmessage.cip4; | ||
|
||
import org.cip4.tools.alces.service.jmfmessage.IntegrationUtils; | ||
import org.cip4.tools.alces.service.jmfmessage.JmfMessageService; | ||
import org.springframework.stereotype.Service; | ||
|
||
import javax.swing.filechooser.FileFilter; | ||
import java.io.File; | ||
|
||
@Service | ||
public class ResubmitQueueEntryMessageService implements JmfMessageService { | ||
|
||
@Override | ||
public String getMessageType() { | ||
return "ResubmitQueueEntry"; | ||
} | ||
|
||
@Override | ||
public String getButtonTextExtension() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public String createJmfMessage(IntegrationUtils integrationUtils) { | ||
|
||
return ""; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
...ovy/org/cip4/tools/alces/service/jmfmessage/cip4/StopPersistentChannelMessageService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package org.cip4.tools.alces.service.jmfmessage.cip4; | ||
|
||
import org.cip4.tools.alces.service.jmfmessage.IntegrationUtils; | ||
import org.cip4.tools.alces.service.jmfmessage.JmfMessageService; | ||
import org.springframework.stereotype.Service; | ||
|
||
@Service | ||
public class StopPersistentChannelMessageService implements JmfMessageService { | ||
|
||
@Override | ||
public String getMessageType() { | ||
return "StopPersistentChannel"; | ||
} | ||
|
||
@Override | ||
public String getButtonTextExtension() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public String createJmfMessage(IntegrationUtils integrationUtils) { | ||
return integrationUtils.getJmfBuilder() | ||
.buildStopPersistentChannel(null, null, integrationUtils.getSubscriberUrl()) | ||
.toXML(); | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
...n/groovy/org/cip4/tools/alces/service/jmfmessage/cip4/SubmitQueueEntryMessageService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package org.cip4.tools.alces.service.jmfmessage.cip4; | ||
|
||
import org.cip4.jdflib.auto.JDFAutoDeviceFilter; | ||
import org.cip4.tools.alces.service.jmfmessage.IntegrationUtils; | ||
import org.cip4.tools.alces.service.jmfmessage.JmfMessageService; | ||
import org.springframework.stereotype.Service; | ||
|
||
import javax.swing.*; | ||
import javax.swing.filechooser.FileFilter; | ||
import java.io.File; | ||
|
||
@Service | ||
public class SubmitQueueEntryMessageService implements JmfMessageService { | ||
|
||
@Override | ||
public String getMessageType() { | ||
return "SubmitQueueEntry"; | ||
} | ||
|
||
@Override | ||
public String getButtonTextExtension() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public String createJmfMessage(IntegrationUtils integrationUtils) { | ||
|
||
// define file filter | ||
FileFilter fileFilter = new FileFilter() { | ||
@Override | ||
public boolean accept(File file) { | ||
return file.getName().toLowerCase().endsWith(".jdf") | ||
|| (file.isDirectory() && !file.getName().startsWith(".")); | ||
} | ||
|
||
@Override | ||
public String getDescription() { | ||
return "JDF Job Tickets (*.jdf)"; | ||
} | ||
}; | ||
|
||
// select file to be submitted | ||
File file = integrationUtils.selectFile("Select JDF File", fileFilter); | ||
|
||
// create message | ||
return integrationUtils.getJmfBuilder() | ||
.buildSubmitQueueEntry(integrationUtils.getReturnUrl(), integrationUtils.publishFile(file)) | ||
.toXML(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.