Class JobImpl
JFR: July 06, 2018: Made some modifications to improve thread-safety since this webservice can be used like this:
Client applications can call methods from multiple threads and can even simulate multiple clients using multiple threads in the same app.
Also it should not be possible to operate this webservice using an empty clientID.
Classes related to JobClient: Channel.WriteJobfile
This Webservices interface contains the methods for accessing Claro with jobfiles. The interface is published by JAX-WS RI with : http://<hostname>:<port>/jclarojaxws/job?wsdl
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic long
static long
static long
-
Constructor Summary
ConstructorsConstructorDescriptionJobImpl()
JobImpl should be instanced with JobImplService (see snippet above) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Cancel a single jobvoid
cancelJobs(byte[] userToken, String clientID, String jobIDsCommaSeparated, String channelName)
cancels the current job(s), all related folders are removed, will skip jobID's that are invalid (-1).void
checkClientID(byte[] userToken, String clientID)
checks if ClientID is valid or if the maximum is already reached For internal usage a maximum number of clients can be used, if the maximum number of clients is exceeded, error The maximum number is bounded to the license name, convention _JCx_ where x is the maximum.List<com.elpical.jclaro.ws.server.Account>
getAccounts(byte[] userToken)
Returns a list of Accounts registered in Claro.Integer[]
getAllReadyJobs(byte[] userToken, String clientID)
Deprecated.because it lacks the channel parameter and because there are too many methods that call getReadyJobsEx.Integer[]
getAllReadyJobs_withChannel(byte[] userToken, String clientID, String channelName)
Deprecated.because there are too many methods that call getReadyJobsEx.int
getAnyJobReady(byte[] userToken, String clientID)
checks if any job is ready for the actual ClientID.int
getAvailableConcurrentProcesses(byte[] userToken)
Returned number of immediately available (not currently processing something) concurrent processes.getBadJobsForClient(byte[] userToken, String clientID)
Utility method so that clients can get the jobIDs of jobs that are sent to the bad folder.String[]
getChannels(byte[] userToken)
retrieves the installed channelsString[]
getChannelsForGroup(byte[] userToken, String group)
retrieve the channels for the given groupint
getChannelType(byte[] userToken, String channelName)
Get the channel type for the channel with the given name Values can be any of the ChannelType_* constant defined in PrefChannel class.getClaroBackupServers(byte[] userToken)
returns number of available backup Claro servers in multiserver operation (backupserverlist value in ClaroServers.conf)getClaroServers(byte[] userToken)
returns number of available Claro servers in multiserver operation (serverlist value in ClaroServers.conf)getClientID(byte[] userToken)
returns a valid ClientID should be called only once for the calling client.getClientIDinternal(byte[] userToken)
returns a valid ClientID for internal use should not be called, because this ID is bounded to license restrictionsint
getErrorCodeAsInteger(byte[] userToken)
Get the current error code (global scope) Clears the current error code (retrieve once)int
getErrorCodeAsIntegerEx(byte[] userToken, String clientID)
Get the current error code for the given Claro client Clears the current error code (retrieve once)getErrorMessage(byte[] userToken)
Get the current error message (global scope) Clears the current error message (retrieve once)getErrorMessageEx(byte[] userToken, String clientID)
Get the current error message for the given client Clears the current error message (retrieve once)String[]
getGroups(byte[] userToken)
retrieves the installed channel groups all group names are unique, there cannot be multiple groups with the same name.String[]
getGroupsForChannel(byte[] userToken, String channelName)
retrieve the group(s) that have a channel with the given channel name (a channel with a certain name can occur in different groups).javax.activation.DataHandler
getImageFile(byte[] userToken, String clientID, int jobID, String destinationFilename, boolean isSentToInspector)
retrieves the returned ImageFile of the processed imagejavax.activation.DataHandler
getJobFile(byte[] userToken, String clientID, int jobID)
retrieves the returned JobFile with information about the process NOTE: From the JobClient C++ plugin side GSOAP is used to call this method.List<com.elpical.jclaro.ws.server.JobStatus>
getJobInfo(byte[] userToken, String clientID)
Convenient method to reduce the number of requests to this webservice.Clients can retrieve the Claro logging information.getMagazineTitles(byte[] userToken)
retrieves a list of magazine titles configured in plugins/RP/RP_configuration.xml For internal usage only!Integer[]
getReadyJobs(byte[] userToken, String clientID)
Deprecated.because it lacks the channel parameter.Integer[]
getReadyJobs_withChannel(byte[] userToken, String clientID, String channelName)
Deprecated.because there are too many methods that call getReadyJobsEx.Integer[]
getReadyJobsEx(byte[] userToken, String clientID, boolean overrideBadCheck, String channelName)
Get the IDs of jobs that are ready at this moment.getServerVersion(byte[] userToken)
retrieves the server versionstatic boolean
boolean
isChannelActive(byte[] userToken, String channel)
JFR: November 22, 2017: Added this method to enable the JobClient to check whether a channel is active.boolean
isExistingJob(byte[] userToken, String clientID, int jobID)
checks if the job exists.boolean
isJobFileSentToBadFolder(byte[] userToken, String clientID, int jobID)
Deprecated.because it lacks the channel parameter.boolean
isJobFileSentToBadFolderEx(byte[] userToken, String clientID, int jobID, String channelName)
Utility method to check whether a .job file is sent to the Claro bad folder.boolean
isJobImageSentToBadFolder(byte[] userToken, String clientID, int jobID)
Deprecated.because it lacks the channel parameter.boolean
isJobImageSentToBadFolderEx(byte[] userToken, String clientID, int jobID, String channelName)
Utility method to check whether the Image -> PathName file of a .job file is sent to the Claro bad folder.boolean
isJobReady(byte[] userToken, String clientID, int jobID, boolean isSentToInspector, String filenameSuffix)
checks if the job is ready: It starts with checking the bad ('folder for unprocessed images') folder.boolean
isJobTerminated(byte[] userToken, String clientID, int jobID)
Utility method to check if a job was picked up by a thread that has been terminated before completion.boolean
isSentToInspector(byte[] userToken, int jobID, int inspectorID, String channelName, String fileName)
Deprecated.because it lacks the clientID parameter.boolean
isSentToInspectorEx(byte[] userToken, String clientID, int jobID)
Check whether an image has been sent to the Inspector.boolean
isValidLicense(byte[] userToken)
Check whether Claro currently has a valid license installed.void
Keep the session with the given clientID alive.com.elpical.jclaro.ws.server.Account
Logs the user in with the supplied name.void
processImage(byte[] userToken, javax.activation.DataHandler jobData, String imageFilename, javax.activation.DataHandler imageData, String destinationImageFilename, String channelName, String clientID, int jobID)
Core method of the JobClient! send Image with Jobfile to the server and starts processing.void
processImageEx(byte[] userToken, javax.activation.DataHandler jobData, String imageFilename, javax.activation.DataHandler imageData, String channelName, String clientID, int jobID)
(overload) (processImage)void
removes all information on the server related to the specified job
should be called after job is finished and no more data should be retrieved for this job.void
removeJobs(byte[] userToken, String clientID, String jobIDsCommaSeparated)
Remove the given jobs, but will skip jobID's that are invalid (-1).boolean
Checks the server connectionvoid
unregisterClientID(byte[] userToken, String clientid)
unregisters the ClientID all related folders are removed e.g.
-
Field Details
-
JC_WS_CLIENTID_EXPIRATION_TIMEOUT
public static final long JC_WS_CLIENTID_EXPIRATION_TIMEOUT- See Also:
- Constant Field Values
-
JC_WS_CLIENTID_CAAS_EXPIRATION_TIMEOUT
public static final long JC_WS_CLIENTID_CAAS_EXPIRATION_TIMEOUT- See Also:
- Constant Field Values
-
JC_WC_CLIENTID_CHECK_INTERVAL
public static final long JC_WC_CLIENTID_CHECK_INTERVAL- See Also:
- Constant Field Values
-
-
Constructor Details
-
JobImpl
public JobImpl()JobImpl should be instanced with JobImplService (see snippet above)
-
-
Method Details
-
login
Logs the user in with the supplied name. Returns an Account object containing the unique login-token needed in most methods to be able to check the login of the user. The login-token stays valid for 20 minutes after it's last use.- Parameters:
name
- The name of the userpassword
- The password of the user- Returns:
- See Also:
- Description with example
-
getAccounts
public List<com.elpical.jclaro.ws.server.Account> getAccounts(byte[] userToken) throws com.elpical.jclaro.ws.server.LoginException, com.elpical.jclaro.ws.server.PrivilegeExceptionReturns a list of Accounts registered in Claro.- Parameters:
userToken
- The unique login-token of a user with privileges to view Account information- Returns:
- List of Accounts registered in Claro.
- Throws:
com.elpical.jclaro.ws.server.LoginException
- If no user with this login-token is found or the token is expired (20 minutes after last activity).com.elpical.jclaro.ws.server.PrivilegeException
- User has no privileges to see Account information.- See Also:
Account.getAccountPrivileges()
-
getChannels
public String[] getChannels(byte[] userToken) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionretrieves the installed channels- Returns:
- all installed channels
- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
-
getChannelType
public int getChannelType(byte[] userToken, String channelName) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionGet the channel type for the channel with the given name Values can be any of the ChannelType_* constant defined in PrefChannel class.- Parameters:
channelName
-- Returns:
- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
-
getGroups
public String[] getGroups(byte[] userToken) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionretrieves the installed channel groups all group names are unique, there cannot be multiple groups with the same name.- Returns:
- String[]
- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
-
getGroupsForChannel
public String[] getGroupsForChannel(byte[] userToken, String channelName) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionretrieve the group(s) that have a channel with the given channel name (a channel with a certain name can occur in different groups).NOTE: The name is a bit misleading: A channel can only belong to one group at a time.
- Parameters:
channelName
- The name of the channel to get the groups for- Returns:
- String[]
- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
-
getChannelsForGroup
public String[] getChannelsForGroup(byte[] userToken, String group) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionretrieve the channels for the given group- Parameters:
group
- Group to retrieve the channels for- Returns:
- String[]
- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
-
isChannelActive
public boolean isChannelActive(byte[] userToken, String channel) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionJFR: November 22, 2017: Added this method to enable the JobClient to check whether a channel is active. This is a solution for issue #180.- Parameters:
channel
-- Returns:
- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
-
isJobReady
public boolean isJobReady(byte[] userToken, String clientID, int jobID, boolean isSentToInspector, String filenameSuffix) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionchecks if the job is ready: It starts with checking the bad ('folder for unprocessed images') folder.Might set one the following error codes:
- JC_WS_EC_INVALID_CLIENT_ID (0) - when the given clientID is invalid. - JC_WS_EC_INVALID_JOB_ID (8) - when the given JobID is invalid. - JC_WS_EC_JOB_FILE_SENT_TO_BAD_FOLDER (9) - when the job file has been sent to the bad folder. - JC_WS_EC_JOB_IMAGE_SENT_TO_BAD_FOLDER (10) - when the image file has been sent to the bad folder (overwrites previous error code). - JC_WS_EC_JOB_DOES_NOT_EXIST (6) - when the processed folder for the given job does not exist.
- Parameters:
clientID
- ClientID e.g. ID0001jobID
- JobIDisSentToInspector
- Channel sends to Inspector?filenameSuffix
- (deprecated, because it is not the clients concern to use the right prefix, suffix, etc.) The suffix for the filename (still used by JC for InDesign)- Returns:
- - true if the job is ready otherwise false, see remarks below:
0) true when: the clientID is empty or invalid. 1) true when: the jobID is invalid. 2) true when: the job file has been sent to the bad folder. 3) true when: the image file has been sent to the bad folder. 4) true when: isSentToInspector is true and the image file (without suffix) exists in the job processed folder. 5) true when: isSentToInspector is true and the image file (with suffix) exists in the job processed folder. 6) true when: isSentToInspector is false and the job folder contains a valid/complete result. 7) true when: the job folder does not exist at all. 8) Modified this so this returns true if a job has failed or when it is sent to the bad folder - Then technically it is also done and clients do not keep waiting forever.
- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
- See Also:
isExistingJob(byte[], java.lang.String, int)
-
getAnyJobReady
public int getAnyJobReady(byte[] userToken, String clientID) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionchecks if any job is ready for the actual ClientID. This is a different approach compared to the isJobReady method which checks only for a job with a certain ID. This is a different approach compared to the getReadyJobsEx method which returns an array of jobIDs. The order of returned jobID's is random: The ID of the first job that is found ready is returned.Might set one the following error codes:
- JC_WS_EC_INVALID_CLIENT_ID (0) - when the given clientID is invalid.
- Parameters:
clientID
- ClientID- Returns:
- the JobID which is ready, if no job is ready the value -1 is returned. If no actual job is present, -2 is returned
- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
-
getAllReadyJobs
public Integer[] getAllReadyJobs(byte[] userToken, String clientID) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionDeprecated.because it lacks the channel parameter and because there are too many methods that call getReadyJobsEx.(overload) (getReadyJobsEx)Get the IDs of ALL jobs that are ready at this moment, including those that went to the bad folder. This is determined by looking for files in the processed folder of a job.
Wrapper method for: getReadyJobsEx
IMPORTANT NOTE: It is recommended to use getReadyJobs_withChannel instead: So it can retrieve the correct 'folder for unprocessed images' value using the given channel name, otherwise the default value is used which might not always be correct.
- Parameters:
userToken
-clientID
-- Returns:
- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
-
getAllReadyJobs_withChannel
public Integer[] getAllReadyJobs_withChannel(byte[] userToken, String clientID, String channelName) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionDeprecated.because there are too many methods that call getReadyJobsEx.(overload) (getReadyJobsEx)Wrapper method for: getReadyJobsEx
Get the IDs of ALL jobs that are ready at this moment, including those that went to the bad folder. This is determined by looking for files in the processed folder of a job.
IMPORTANT NOTE: It is recommended to use getReadyJobs_withChannel instead.
- Parameters:
userToken
-clientID
-channelName
-- Returns:
- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
-
getReadyJobs
public Integer[] getReadyJobs(byte[] userToken, String clientID) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionDeprecated.because it lacks the channel parameter.(overload) (getReadyJobsEx)- Parameters:
userToken
-clientID
-- Returns:
- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
-
getReadyJobs_withChannel
public Integer[] getReadyJobs_withChannel(byte[] userToken, String clientID, String channelName) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionDeprecated.because there are too many methods that call getReadyJobsEx.(overload) (getReadyJobsEx)- Parameters:
userToken
-clientID
-channelName
-- Returns:
- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
-
getReadyJobsEx
public Integer[] getReadyJobsEx(byte[] userToken, String clientID, boolean overrideBadCheck, String channelName) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionGet the IDs of jobs that are ready at this moment. This is determined by looking for files in the processed folder of a job. (Extension for the other methods above) Solution for issue #297. This is a different approach compared to the isJobReady method which checks only for a job with a certain ID. This is a different approach compared to the getAnyJobReady method which returns only one jobID.Might set one the following error codes:
- JC_WS_EC_INVALID_CLIENT_ID (0) - when the given clientID is invalid.
- Parameters:
userToken
-clientID
-overrideBadCheck
- (deprecated) Only checks the 'folder for unprocessed images' when this is set to false, otherwise it will skip such checks, but continues regardless.channelName
- (deprecated)- Returns:
- A list with the jobs that are currently found ready.
- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
-
getJobFile
public javax.activation.DataHandler getJobFile(byte[] userToken, String clientID, int jobID) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionretrieves the returned JobFile with information about the process NOTE: From the JobClient C++ plugin side GSOAP is used to call this method.Might set one the following error codes:
- JC_WS_EC_INVALID_CLIENT_ID (0) - when the given clientID is invalid. - JC_WS_EC_INVALID_JOB_ID (8) - when the given JobID is invalid. - JC_WS_EC_JOB_DOES_NOT_EXIST (6) - if the job file does not exist.
- Parameters:
userToken
-clientID
- ClientIDjobID
- JobID- Returns:
- DataHandler for the returned JobFile, if the datahandler can not be generated, error
- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
-
removeJob
public void removeJob(byte[] userToken, String clientID, int jobID) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionremoves all information on the server related to the specified job
should be called after job is finished and no more data should be retrieved for this job.
Might set one the following error codes:
- JC_WS_EC_INVALID_CLIENT_ID (0) - when the given clientID is invalid. - JC_WS_EC_INVALID_JOB_ID (8) - when the given JobID is invalid.
- Parameters:
userToken
-clientID
- ClientIDjobID
- JobID- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
-
removeJobs
public void removeJobs(byte[] userToken, String clientID, String jobIDsCommaSeparated) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionRemove the given jobs, but will skip jobID's that are invalid (-1).Might set one the following error codes:
- JC_WS_EC_INVALID_CLIENT_ID (0) - when the given clientID is invalid.
- Parameters:
userToken
-clientID
- ClientIDjobIDsCommaSeparated
- comma separated string with job id's or the string 'all' for all jobs of the related ClientID- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
-
cancelJob
public void cancelJob(byte[] userToken, String clientID, int jobID, String channelName) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionCancel a single jobMight set one the following error codes:
- JC_WS_EC_INVALID_CLIENT_ID (0) - when the given clientID is invalid. - JC_WS_EC_INVALID_JOB_ID (8) - when the given jobID is invalid.
- Parameters:
userToken
-clientID
-jobID
-channelName
-- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
-
cancelJobs
public void cancelJobs(byte[] userToken, String clientID, String jobIDsCommaSeparated, String channelName) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptioncancels the current job(s), all related folders are removed, will skip jobID's that are invalid (-1).Might set one the following error codes:
- JC_WS_EC_INVALID_CLIENT_ID (0) - when the given clientID is invalid.
- Parameters:
userToken
-clientID
- ClientIDjobIDsCommaSeparated
- comma separated string with job id's or the string 'all' for all jobs of the related ClientIDchannelName
- the name of channel for deleting the jobfiles in the related channel or null for not deleting the jobfiles in the related channel- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
-
isExistingJob
public boolean isExistingJob(byte[] userToken, String clientID, int jobID) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionchecks if the job exists. This is determined by checking whether the job folder exists, e.g. /jobclient/ID0001/job0/Might set one the following error codes:
- JC_WS_EC_INVALID_CLIENT_ID (0) - when the given clientID is invalid. - JC_WS_EC_INVALID_JOB_ID (8) - when the given jobID is invalid.
- Parameters:
userToken
-clientID
- ClientIDjobID
- JobID- Returns:
- true if the job folder exists otherwise false
- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
-
getBadJobsForClient
public ArrayList<Integer> getBadJobsForClient(byte[] userToken, String clientID) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionUtility method so that clients can get the jobIDs of jobs that are sent to the bad folder. This only works if the method: isJobFileSentToBadFolder has done its work, in other words: If clients are checking whether jobs are ready, this list begins to fill possibly with jobIDs of bad jobs.Might set one the following error codes:
- JC_WS_EC_INVALID_CLIENT_ID (0) - when the given clientID is invalid.
- Parameters:
userToken
-clientID
-- Returns:
- A list containing the jobID(s) for jobs that are sent to the bad folder, otherwise an empty list, but never null.
- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
- See Also:
isJobFileSentToBadFolderEx(byte[], java.lang.String, int, java.lang.String)
-
isJobFileSentToBadFolder
public boolean isJobFileSentToBadFolder(byte[] userToken, String clientID, int jobID) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionDeprecated.because it lacks the channel parameter.Utility method to check whether a .job file is sent to the Claro bad folder.IMPORTANT NOTE: It is recommended to use isJobFileSentToBadFolderEx instead: So it can retrieve the correct 'folder for unprocessed images' value using the given channel name, otherwise the default value is used which might not always be correct.
- Parameters:
userToken
-clientID
-jobID
-- Returns:
- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
- See Also:
getBadJobsForClient(byte[], java.lang.String)
-
isJobFileSentToBadFolderEx
public boolean isJobFileSentToBadFolderEx(byte[] userToken, String clientID, int jobID, String channelName) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionUtility method to check whether a .job file is sent to the Claro bad folder.Might set one the following error codes:
- JC_WS_EC_INVALID_CLIENT_ID (0) - when the given clientID is invalid. - JC_WS_EC_INVALID_JOB_ID (8) - when the given jobID is invalid. - JC_WS_EC_JOB_FILE_SENT_TO_BAD_FOLDER (9) - if the job file has been sent to the bad folder. - JC_WS_EC_JOB_FILE_SENT_TO_BAD_FOLDER (9) - if the job file exists in the bad folder.
- Parameters:
userToken
-clientID
-jobID
-channelName
-- Returns:
- - true when: the job file has been sent to the bad folder. - true when: the job file exists in the bad folder. - true when: the job file exists in the bad folder and the folder structure (e.g. /Claro/jobclient/CL0001/job1) is also present.
- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
-
isJobImageSentToBadFolder
public boolean isJobImageSentToBadFolder(byte[] userToken, String clientID, int jobID) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionDeprecated.because it lacks the channel parameter.(overload) (isJobImageSentToBadFolderEx)IMPORTANT NOTE: It is recommended to use isJobImageSentToBadFolderEx instead: So it can retrieve the correct 'folder for unprocessed images' value using the given channel name, otherwise the default value is used which might not always be correct.
- Parameters:
userToken
-clientID
-jobID
-- Returns:
- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
-
isJobImageSentToBadFolderEx
public boolean isJobImageSentToBadFolderEx(byte[] userToken, String clientID, int jobID, String channelName) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionUtility method to check whether the Image -> PathName file of a .job file is sent to the Claro bad folder. If this happens, then the original file is sent to the bad folder and the Claro jobclient job folder will contain an empty processed subfolder.Might set one the following error codes:
- JC_WS_EC_INVALID_CLIENT_ID (0) - when the given clientID is invalid. - JC_WS_EC_INVALID_JOB_ID (8) - when the given jobID is invalid. - JC_WS_EC_JOB_IMAGE_SENT_TO_BAD_FOLDER (10) - if the image file has been sent to the bad folder.
- Parameters:
userToken
-clientID
-jobID
-channelName
- Needed to retrieve the 'folder for unprocessed images' of the channel.- Returns:
- true of the job image file is present in the folder for unprocessed images. See remarks below:
1) true when: Could be that multiple clients are connected to the same Claro server and perhaps that jobs that have been moved to the bad folder no longer exist in the Claro jobclient folder or have been canceled by JobClient itself. (For example: /Claro/jobclient/CL0001/job1/ might not exist)
2) true when: The processed folder (/Claro/jobclient/CL0001/job1/processed) for the job is empty or contains only the return job file (jc.job) AND whether (/Claro/jobclient/CL0001/job1/) contains the jc.job file and the original image file is present in that folder OR the job could not be fully processed for some reason and (/Claro/jobclient/CL0001/job1/) contains the jc.job file and the original image file.
- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
- See Also:
isJobTerminated(byte[], java.lang.String, int)
-
isJobTerminated
public boolean isJobTerminated(byte[] userToken, String clientID, int jobID) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionUtility method to check if a job was picked up by a thread that has been terminated before completion. This will allow the clients to properly respond to this.Might set one the following error codes:
- JC_WS_EC_INVALID_CLIENT_ID (0) - when the given clientID is invalid. - JC_WS_EC_INVALID_JOB_ID (8) - when the given jobID is invalid.
- Parameters:
userToken
-clientID
-jobID
-- Returns:
- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
-
getJobInfo
public List<com.elpical.jclaro.ws.server.JobStatus> getJobInfo(byte[] userToken, String clientID) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionConvenient method to reduce the number of requests to this webservice. There is no need to call separate methods anymore: - isSentToInspectorEx - isJobImageSentToBadFolderEx - isJobFileSentToBadFolderEx - isJobTerminated - isJobReady- Parameters:
userToken
-clientID
-- Returns:
- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
-
testConnection
public boolean testConnection()Checks the server connection- Returns:
- true if connected to the server
-
keepAlive
public void keepAlive(byte[] userToken, String clientID) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionKeep the session with the given clientID alive. Clients that do not respond will expire after a certain timeout.Might set one the following error codes:
- JC_WS_EC_INVALID_CLIENT_ID (0) - when the given clientID is invalid.
- Parameters:
userToken
-clientID
-- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
-
getServerVersion
public String getServerVersion(byte[] userToken) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionretrieves the server version- Parameters:
userToken
-- Returns:
- server version
- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
-
getClaroServers
public ArrayList<String> getClaroServers(byte[] userToken) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionreturns number of available Claro servers in multiserver operation (serverlist value in ClaroServers.conf)- Parameters:
userToken
-- Returns:
- list of servers. returns null if multiserver operation has not been configured.
- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
-
getClaroBackupServers
public ArrayList<String> getClaroBackupServers(byte[] userToken) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionreturns number of available backup Claro servers in multiserver operation (backupserverlist value in ClaroServers.conf)- Parameters:
userToken
-- Returns:
- list of backup servers. returns null if multiserver operation has not been configured.
- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
-
getAvailableConcurrentProcesses
public int getAvailableConcurrentProcesses(byte[] userToken) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionReturned number of immediately available (not currently processing something) concurrent processes.- Parameters:
userToken
-- Returns:
- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
-
getClientID
public String getClientID(byte[] userToken) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionreturns a valid ClientID should be called only once for the calling client. A maximum number of clients can be used, if the maximum number of clients is exceeded, error The maximum number is bounded to the license name, convention _JCx_ where x is the maximum.- Parameters:
userToken
-- Returns:
- valid ClientID
- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
-
getClientIDinternal
public String getClientIDinternal(byte[] userToken) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionreturns a valid ClientID for internal use should not be called, because this ID is bounded to license restrictions- Parameters:
userToken
-- Returns:
- valid ClientID
- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
-
checkClientID
public void checkClientID(byte[] userToken, String clientID) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionchecks if ClientID is valid or if the maximum is already reached For internal usage a maximum number of clients can be used, if the maximum number of clients is exceeded, error The maximum number is bounded to the license name, convention _JCx_ where x is the maximum.Might set one the following error codes:
- JC_WS_EC_INVALID_CLIENT_ID (0) - when the given clientID is invalid.
- Parameters:
userToken
-clientID
- ClientID- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
-
unregisterClientID
public void unregisterClientID(byte[] userToken, String clientid) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionunregisters the ClientID all related folders are removed e.g. /jobclient/ID0001Might set one the following error codes:
- JC_WS_EC_INVALID_CLIENT_ID (0) - when the given clientID is invalid. - JC_WS_EC_UNREGISTER_FAILED (1) - when the unregister process failed (the client folder will still exist).
- Parameters:
userToken
-clientid
- ClientID- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
-
getLog
public String getLog(byte[] userToken, String channelName) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionClients can retrieve the Claro logging information.- Parameters:
userToken
-channelName
-- Returns:
- log string
- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
-
isValidLicense
public boolean isValidLicense(byte[] userToken) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionCheck whether Claro currently has a valid license installed.- Parameters:
userToken
-- Returns:
- true if the license is valid, false otherwise
- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
-
getMagazineTitles
public ArrayList<String> getMagazineTitles(byte[] userToken) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionretrieves a list of magazine titles configured in plugins/RP/RP_configuration.xml For internal usage only!- Parameters:
userToken
-- Returns:
- list of magazine titles
- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
-
processImage
public void processImage(byte[] userToken, javax.activation.DataHandler jobData, String imageFilename, javax.activation.DataHandler imageData, String destinationImageFilename, String channelName, String clientID, int jobID) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionCore method of the JobClient! send Image with Jobfile to the server and starts processing.Might set one the following error codes:
- JC_WS_EC_INVALID_CLIENT_ID (0) - when the given clientID is invalid. - JC_WS_EC_PREVIOUS_JOB_ID_REUSED (7) - when an attempt is made to re-use a previous/existing jobID. - JC_WS_EC_UNKNOWN_CHANNEL (4) - when the channel with given channelName could not be found.
- Parameters:
userToken
-jobData
- DataHandler for the jobfileimageFilename
- filename of the original imageimageData
- DataHandler for the imagefiledestinationImageFilename
- (deprecated, because it is not the clients concern to use the right prefix, suffix, etc.) the DestinationFileName of the processed image (still used by JC for InDesign)channelName
- the name of the processing channelclientID
- ClientIDjobID
- JobID- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
-
processImageEx
public void processImageEx(byte[] userToken, javax.activation.DataHandler jobData, String imageFilename, javax.activation.DataHandler imageData, String channelName, String clientID, int jobID) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginException(overload) (processImage)- Parameters:
userToken
-jobData
-imageFilename
-imageData
-channelName
-clientID
-jobID
-- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
-
getImageFile
public javax.activation.DataHandler getImageFile(byte[] userToken, String clientID, int jobID, String destinationFilename, boolean isSentToInspector) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionretrieves the returned ImageFile of the processed imageMight set one the following error codes:
- JC_WS_EC_INVALID_CLIENT_ID (0) - when the given clientID is invalid. - JC_WS_EC_INVALID_JOB_ID (8) - when the given jobID is invalid. - JC_WS_EC_IMAGE_IN_JOB_DOES_NOT_EXIST (5) - when the image file could not be found. - JC_WS_EC_JOB_DOES_NOT_EXIST (6) - when the processed folder for the given job does not exist.
- Parameters:
userToken
-clientID
- ClientIDjobID
- JobIDdestinationFilename
- the DestinationFileName of the processed imageisSentToInspector
- Channel sends everything to Inspector?- Returns:
- DataHandler for the returned ImageFile if the datahandler can not be generated, error
- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
-
isSentToInspector
public boolean isSentToInspector(byte[] userToken, int jobID, int inspectorID, String channelName, String fileName) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionDeprecated.because it lacks the clientID parameter.Check whether an image has been sent to the Inspector.- Parameters:
userToken
-jobID
- (deprecated) - The job ID, e.g. 1inspectorID
- The inspector item ID, e.g. 1channelName
- (deprecated) - The name of the channel, e.g. WebfileName
- (deprecated) - The filename to check, e.g. myfile.jpg- Returns:
- true if the image is sent to the Inspector, false otherwise
- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
-
isSentToInspectorEx
public boolean isSentToInspectorEx(byte[] userToken, String clientID, int jobID) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionCheck whether an image has been sent to the Inspector.- Parameters:
userToken
-clientID
- The clientID, e.g. CL0001jobID
- The job ID, e.g. 1- Returns:
- true if the image is sent to the Inspector, false otherwise
- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
-
getErrorCodeAsInteger
public int getErrorCodeAsInteger(byte[] userToken) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionGet the current error code (global scope) Clears the current error code (retrieve once)- Parameters:
userToken
-- Returns:
- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
-
getErrorCodeAsIntegerEx
public int getErrorCodeAsIntegerEx(byte[] userToken, String clientID) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionGet the current error code for the given Claro client Clears the current error code (retrieve once)- Parameters:
userToken
-clientID
-- Returns:
- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
-
getErrorMessage
public String getErrorMessage(byte[] userToken) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionGet the current error message (global scope) Clears the current error message (retrieve once)- Parameters:
userToken
-- Returns:
- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
-
getErrorMessageEx
public String getErrorMessageEx(byte[] userToken, String clientID) throws com.elpical.jclaro.ws.server.PrivilegeException, com.elpical.jclaro.ws.server.LoginExceptionGet the current error message for the given client Clears the current error message (retrieve once)- Parameters:
userToken
-clientID
-- Returns:
- Throws:
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
com.elpical.jclaro.ws.server.PrivilegeException
com.elpical.jclaro.ws.server.LoginException
-
isCaaSVersion
public static boolean isCaaSVersion()
-