Issue #2361 remove XML annotations from localization requests/responses

Change-Id: Ia2aa791f7e68524d19f24522c7824a977d25d58f

Former-commit-id: 8e17babd91 [formerly dd75847b7b] [formerly 8e17babd91 [formerly dd75847b7b] [formerly 396e69180d [formerly ef569f59ca91c73cfbfad4b062fb0110d33533d3]]]
Former-commit-id: 396e69180d
Former-commit-id: 28ce7782fe [formerly 3b92de5abc]
Former-commit-id: 38edfa0d07
This commit is contained in:
Nate Jensen 2013-10-01 17:05:24 -05:00
parent 580f3be05d
commit c18e9ee060
21 changed files with 64 additions and 467 deletions

View file

@ -1,14 +0,0 @@
com.raytheon.uf.common.localization.msgs.GetUtilityCommand
com.raytheon.uf.common.localization.msgs.GetUtilityResponse
com.raytheon.uf.common.localization.msgs.ListContextCommand
com.raytheon.uf.common.localization.msgs.ListUtilityCommand
com.raytheon.uf.common.localization.msgs.ListUtilityResponse
com.raytheon.uf.common.localization.msgs.ProtectedFileCommand
com.raytheon.uf.common.localization.msgs.ProtectedFileResponse
com.raytheon.uf.common.localization.msgs.ListResponseEntry
com.raytheon.uf.common.localization.msgs.UtilityRequestMessage
com.raytheon.uf.common.localization.msgs.UtilityResponseMessage
com.raytheon.uf.common.localization.msgs.DeleteUtilityCommand
com.raytheon.uf.common.localization.msgs.DeleteUtilityResponse
com.raytheon.uf.common.localization.FileUpdatedMessage
com.raytheon.uf.common.localization.LocalizationContext

View file

@ -19,13 +19,6 @@
**/
package com.raytheon.uf.common.localization;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import com.raytheon.uf.common.serialization.ISerializableObject;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
@ -37,34 +30,30 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 12, 2008 randerso Initial creation
* Oct 01, 2013 2361 njensen Removed XML annotations
*
* </pre>
*
* @author randerso
* @version 1.0
*/
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
@DynamicSerialize
public class FileUpdatedMessage implements ISerializableObject {
public class FileUpdatedMessage {
public static enum FileChangeType {
ADDED, UPDATED, DELETED
};
@DynamicSerializeElement
@XmlElement
private LocalizationContext context;
@DynamicSerializeElement
@XmlAttribute
private String fileName;
@DynamicSerializeElement
@XmlElement
private FileChangeType changeType;
@DynamicSerializeElement
@XmlAttribute
private long timeStamp;
public FileUpdatedMessage() {

View file

@ -26,16 +26,9 @@ import java.util.HashMap;
import java.util.Map;
import java.util.regex.Pattern;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.adapters.XmlAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.apache.commons.lang.Validate;
import com.raytheon.uf.common.serialization.IDeserializationContext;
import com.raytheon.uf.common.serialization.ISerializableObject;
import com.raytheon.uf.common.serialization.ISerializationContext;
import com.raytheon.uf.common.serialization.ISerializationTypeAdapter;
import com.raytheon.uf.common.serialization.SerializationException;
@ -69,6 +62,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeTypeAdap
* ------------ ---------- ----------- --------------------------
* Apr 19, 2007 chammack Initial Creation.
* Jul 14, 2008 1250 jelkins EDEX LocalizationAdapter additions.
* Oct 01, 2013 2361 njensen Removed XML annotations and methods
*
* </pre>
*
@ -76,8 +70,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeTypeAdap
* @version 1.0
*/
@DynamicSerialize
@XmlAccessorType(XmlAccessType.NONE)
public class LocalizationContext implements ISerializableObject, Cloneable {
public class LocalizationContext implements Cloneable {
/**
* NOTE: When making changes to LocalizationLevelSerializationAdapter, you
@ -86,14 +79,9 @@ public class LocalizationContext implements ISerializableObject, Cloneable {
* LocalizationLevelSerializationAdapter.py
*
*/
public static class LocalizationLevelSerializationAdapter extends
XmlAdapter<String, LocalizationLevel> implements
public static class LocalizationLevelSerializationAdapter implements
ISerializationTypeAdapter<LocalizationLevel> {
private static final String separator = "||";
private static final String split = "[|][|]";
/*
* (non-Javadoc)
*
@ -127,37 +115,6 @@ public class LocalizationContext implements ISerializableObject, Cloneable {
return level;
}
/*
* (non-Javadoc)
*
* @see
* javax.xml.bind.annotation.adapters.XmlAdapter#marshal(java.lang.Object
* )
*/
@Override
public String marshal(LocalizationLevel v) throws Exception {
String rval = v.text + separator + Integer.toString(v.order)
+ separator + v.systemLevel + separator;
return rval;
}
/*
* (non-Javadoc)
*
* @see
* javax.xml.bind.annotation.adapters.XmlAdapter#unmarshal(java.lang
* .Object)
*/
@Override
public LocalizationLevel unmarshal(String v) throws Exception {
String[] parts = v.split(split);
int i = 0;
LocalizationLevel level = LocalizationLevel.createLevel(parts[i++],
Integer.parseInt(parts[i++]),
Boolean.parseBoolean(parts[i++]));
return level;
}
}
/**
@ -167,8 +124,7 @@ public class LocalizationContext implements ISerializableObject, Cloneable {
* LocalizationTypeSerializationAdapter.py
*
*/
public static class LocalizationTypeSerializationAdapter extends
XmlAdapter<String, LocalizationType> implements
public static class LocalizationTypeSerializationAdapter implements
ISerializationTypeAdapter<LocalizationType> {
/*
@ -198,30 +154,6 @@ public class LocalizationContext implements ISerializableObject, Cloneable {
return LocalizationType.valueOf(deserializer.readString());
}
/*
* (non-Javadoc)
*
* @see
* javax.xml.bind.annotation.adapters.XmlAdapter#unmarshal(java.lang
* .Object)
*/
@Override
public LocalizationType unmarshal(String v) throws Exception {
return LocalizationType.valueOf(v);
}
/*
* (non-Javadoc)
*
* @see
* javax.xml.bind.annotation.adapters.XmlAdapter#marshal(java.lang.Object
* )
*/
@Override
public String marshal(LocalizationType v) throws Exception {
return v.text;
}
}
private static final char CONTEXT_SEPARATOR = '.';
@ -237,7 +169,6 @@ public class LocalizationContext implements ISerializableObject, Cloneable {
*/
@DynamicSerialize
@DynamicSerializeTypeAdapter(factory = LocalizationTypeSerializationAdapter.class)
@XmlJavaTypeAdapter(value = LocalizationTypeSerializationAdapter.class)
public static class LocalizationType {
private static Map<String, LocalizationType> typeMap = new HashMap<String, LocalizationType>();
@ -324,7 +255,6 @@ public class LocalizationContext implements ISerializableObject, Cloneable {
*/
@DynamicSerialize
@DynamicSerializeTypeAdapter(factory = LocalizationLevelSerializationAdapter.class)
@XmlJavaTypeAdapter(value = LocalizationLevelSerializationAdapter.class)
public static class LocalizationLevel implements
Comparable<LocalizationLevel> {
@ -486,15 +416,12 @@ public class LocalizationContext implements ISerializableObject, Cloneable {
BUNDLE, PLUGIN, COLORMAPS, CONFIG, PYTHON, SMARTINIT, GRID, SHAPEFILES, TEXTPRODUCTS
};
@XmlAttribute
@DynamicSerializeElement
private LocalizationType localizationType;
@XmlAttribute
@DynamicSerializeElement
private LocalizationLevel localizationLevel;
@XmlAttribute
@DynamicSerializeElement
private String contextName;

View file

@ -1,11 +1,6 @@
package com.raytheon.uf.common.localization.msgs;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import com.raytheon.uf.common.localization.LocalizationContext;
import com.raytheon.uf.common.serialization.ISerializableObject;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
@ -17,17 +12,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 4, 2010 rgeorge Initial creation
* Jun 4, 2010 rgeorge Initial creation
* Oct 1, 2013 2361 njensen Removed XML annotations
*
* </pre>
*
* @author rgeorge
* @version 1.0
*/
@XmlAccessorType(XmlAccessType.NONE)
@DynamicSerialize
public abstract class AbstractCommand implements ISerializableObject {
@XmlElement
public abstract class AbstractCommand {
@DynamicSerializeElement
protected LocalizationContext context;

View file

@ -1,10 +1,5 @@
package com.raytheon.uf.common.localization.msgs;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import com.raytheon.uf.common.localization.LocalizationContext;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
@ -17,22 +12,21 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 3, 2010 rgeorge Initial creation
* Jun 3, 2010 rgeorge Initial creation
* Oct 1, 2013 2361 njensen Removed XML annotations
*
* </pre>
*
* @author rgeorge
* @version 1.0
*/
@XmlAccessorType(XmlAccessType.NONE)
@DynamicSerialize
public class AbstractPrivilegedUtilityCommand extends AbstractCommand {
@XmlAttribute
@DynamicSerializeElement
protected String filename;
@XmlElement
@DynamicSerializeElement
protected String myContextName;

View file

@ -20,9 +20,6 @@
package com.raytheon.uf.common.localization.msgs;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import com.raytheon.uf.common.localization.LocalizationContext;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
@ -39,13 +36,14 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
* ------------ ---------- ----------- --------------------------
* Apr 19, 2007 chammack Initial Creation.
* Aug 22, 2008 #1502 bclement Added JAXB/Serializable annotations
* Oct 01, 2013 2361 njensen Removed XML annotations
*
* </pre>
*
* @author chammack
* @version 1.0
*/
@XmlAccessorType(XmlAccessType.NONE)
@DynamicSerialize
public abstract class AbstractUtilityCommand extends AbstractCommand {

View file

@ -20,13 +20,7 @@
package com.raytheon.uf.common.localization.msgs;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import com.raytheon.uf.common.localization.LocalizationContext;
import com.raytheon.uf.common.serialization.ISerializableObject;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
@ -38,30 +32,28 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 19, 2007 chammack Initial Creation.
* May 19, 2007 #1127 randerso Implemented error reporting
* May 19, 2007 #1127 randerso Implemented error reporting
* Aug 22, 2008 #1502 bclement Added JAXB/Serializable annotations
* Oct 01, 2013 2361 njensen Removed XML annotations
*
* </pre>
*
* @author chammack
* @version 1.0
*/
@XmlAccessorType(XmlAccessType.NONE)
@DynamicSerialize
public abstract class AbstractUtilityResponse implements ISerializableObject {
@XmlElement
@DynamicSerialize
public abstract class AbstractUtilityResponse {
@DynamicSerializeElement
protected LocalizationContext context;
@XmlAttribute
@DynamicSerializeElement
protected String pathName;
/**
* Error message, null = no errors occurred
*/
@XmlAttribute
@DynamicSerializeElement
protected String errorText;

View file

@ -20,10 +20,6 @@
package com.raytheon.uf.common.localization.msgs;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import com.raytheon.uf.common.localization.LocalizationContext;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
@ -36,13 +32,13 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
* ------------ ---------- ----------- --------------------------
* Jul 30, 2007 njensen Initial creation
* Aug 22, 2008 #1502 bclement Added JAXB/Serializable annotations
* Oct 01, 2013 2361 njensen Removed XML annotations
*
* </pre>
*
* @author njensen
*/
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
@DynamicSerialize
public class DeleteUtilityCommand extends AbstractPrivilegedUtilityCommand {

View file

@ -20,11 +20,6 @@
package com.raytheon.uf.common.localization.msgs;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import com.raytheon.uf.common.localization.LocalizationContext;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
@ -37,19 +32,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jul 30, 2007 njensen Initial creation
* May 19, 2007 #1127 randerso Implemented error reporting
* May 19, 2007 #1127 randerso Implemented error reporting
* Aug 22, 2008 #1502 bclement Added JAXB/Serializable annotations
* Oct 01, 2013 2361 njensen Removed XML annotations
*
* </pre>
*
* @author njensen
*/
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
@DynamicSerialize
public class DeleteUtilityResponse extends AbstractUtilityResponse {
@XmlAttribute
@DynamicSerializeElement
private long timeStamp;

View file

@ -21,7 +21,6 @@ package com.raytheon.uf.common.localization.msgs;
import java.util.Map;
import com.raytheon.uf.common.serialization.ISerializableObject;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
@ -44,7 +43,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
* @version 1.0
*/
@DynamicSerialize
public class GetServersResponse implements ISerializableObject {
public class GetServersResponse {
@DynamicSerializeElement
private String httpServer;

View file

@ -20,11 +20,6 @@
package com.raytheon.uf.common.localization.msgs;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
@ -41,19 +36,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 19, 2007 chammack Initial Creation.
* Aug 22, 2008 #1502 bclement Added JAXB/Serializable annotations
* Aug 22, 2008 1502 bclement Added JAXB/Serializable annotations
* Oct 01, 2013 2361 njensen Removed XML annotations
*
* </pre>
*
* @author chammack
* @version 1.0
*/
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
@DynamicSerialize
public class GetUtilityCommand extends AbstractUtilityCommand {
@XmlAttribute
@DynamicSerializeElement
protected String fileName;

View file

@ -20,12 +20,6 @@
package com.raytheon.uf.common.localization.msgs;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import com.raytheon.uf.common.localization.LocalizationContext;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
@ -39,24 +33,22 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 19, 2007 chammack Initial Creation.
* May 19, 2007 #1127 randerso Implemented error reporting
* May 19, 2007 #1127 randerso Implemented error reporting
* Aug 22, 2008 #1502 bclement Added JAXB/Serializable annotations
* Oct 01, 2013 2361 njensen Removed XML annotations
*
* </pre>
*
* @author chammack
* @version 1.0
*/
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
@DynamicSerialize
public class GetUtilityResponse extends AbstractUtilityResponse {
@XmlElement
@DynamicSerializeElement
protected byte[] data;
@XmlAttribute
@DynamicSerializeElement
protected String checksum;
@ -114,7 +106,8 @@ public class GetUtilityResponse extends AbstractUtilityResponse {
/*
* (non-Javadoc)
*
* @see com.raytheon.edex.msg.utility.AbstractUtilityResponse#getFormattedErrorMessage()
* @see com.raytheon.edex.msg.utility.AbstractUtilityResponse#
* getFormattedErrorMessage()
*/
@Override
public String getFormattedErrorMessage() {

View file

@ -19,11 +19,6 @@
**/
package com.raytheon.uf.common.localization.msgs;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
@ -38,7 +33,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Nov 2, 2010 mpduff Initial creation
* Nov 2, 2010 mpduff Initial creation
* Oct 1, 2013 2361 njensen Removed XML annotations
*
* </pre>
*
@ -46,12 +42,9 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
* @version 1.0
*/
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
@DynamicSerialize
public class ListContextCommand extends AbstractUtilityCommand {
@XmlAttribute
@DynamicSerializeElement
private LocalizationLevel requestLevel;

View file

@ -22,15 +22,8 @@ package com.raytheon.uf.common.localization.msgs;
import java.util.Date;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import com.raytheon.uf.common.localization.LocalizationContext;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
import com.raytheon.uf.common.serialization.ISerializableObject;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
@ -44,42 +37,35 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
* ------------ ---------- ----------- --------------------------
* Apr 19, 2007 chammack Initial Creation.
* Aug 22, 2008 #1502 bclement Added JAXB/Serializable annotations
* Oct 01, 2013 2361 njensen Removed XML annotations
*
* </pre>
*
* @author chammack
* @version 1.0
*/
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
@DynamicSerialize
public class ListResponseEntry implements ISerializableObject {
@XmlAttribute
@DynamicSerialize
public class ListResponseEntry {
@DynamicSerializeElement
protected String fileName;
@XmlElement
@DynamicSerializeElement
protected LocalizationContext context;
@XmlAttribute
@DynamicSerializeElement
protected Date date;
@XmlAttribute
@DynamicSerializeElement
protected String checksum;
@XmlAttribute
@DynamicSerializeElement
protected boolean directory;
@XmlAttribute
@DynamicSerializeElement
protected LocalizationLevel protectedLevel;
@XmlAttribute
@DynamicSerializeElement
protected boolean existsOnServer;

View file

@ -20,11 +20,6 @@
package com.raytheon.uf.common.localization.msgs;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
@ -40,32 +35,28 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 19, 2007 chammack Initial Creation.
* Apr 19, 2007 chammack Initial Creation.
* Aug 22, 2008 #1502 bclement Added JAXB/Serializable annotations
* Oct 01, 2013 2361 njensen Removed XML annotations
*
* </pre>
*
* @author chammack
* @version 1.0
*/
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
@DynamicSerialize
public class ListUtilityCommand extends AbstractUtilityCommand {
@XmlAttribute
@DynamicSerializeElement
String subDirectory;
@XmlAttribute
@DynamicSerializeElement
boolean recursive;
@XmlAttribute
@DynamicSerializeElement
private boolean filesOnly;
@XmlAttribute
@DynamicSerializeElement
private String localizedSite;

View file

@ -20,11 +20,6 @@
package com.raytheon.uf.common.localization.msgs;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import com.raytheon.uf.common.localization.LocalizationContext;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
@ -37,20 +32,19 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 19, 2007 chammack Initial Creation.
* May 19, 2007 #1127 randerso Implemented error reporting
* May 19, 2007 #1127 randerso Implemented error reporting
* Aug 22, 2008 #1502 bclement Added JAXB/Serializable annotations
* Oct 01, 2013 2361 njensen Removed XML annotations
*
* </pre>
*
* @author chammack
* @version 1.0
*/
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
@DynamicSerialize
public class ListUtilityResponse extends AbstractUtilityResponse {
@XmlElement
@DynamicSerializeElement
protected ListResponseEntry[] entries;
@ -95,7 +89,8 @@ public class ListUtilityResponse extends AbstractUtilityResponse {
/*
* (non-Javadoc)
*
* @see com.raytheon.edex.msg.utility.AbstractUtilityResponse#getFormattedErrorMessage()
* @see com.raytheon.edex.msg.utility.AbstractUtilityResponse#
* getFormattedErrorMessage()
*/
@Override
public String getFormattedErrorMessage() {

View file

@ -19,16 +19,12 @@
**/
package com.raytheon.uf.common.localization.msgs;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
/**
* TODO Add Description
* A request for protected files.
*
* <pre>
*
@ -36,21 +32,20 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Aug 26, 2010 mschenke Initial creation
* Oct 01, 2013 2361 njensen Removed XML annotations
*
* </pre>
*
* @author mschenke
* @version 1.0
*/
@XmlAccessorType(XmlAccessType.NONE)
@DynamicSerialize
public class ProtectedFileCommand extends AbstractUtilityCommand {
@XmlAttribute
@DynamicSerializeElement
private String subPath;
@XmlAttribute
@DynamicSerializeElement
private String localizedSite;

View file

@ -19,34 +19,30 @@
**/
package com.raytheon.uf.common.localization.msgs;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
/**
* TODO Add Description
* A response for protected files.
*
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Aug 26, 2010 mschenke Initial creation
* Aug 26, 2010 mschenke Initial creation
* Oct 01, 2013 2361 njensen Removed XML annotations
*
* </pre>
*
* @author mschenke
* @version 1.0
*/
@XmlAccessorType(XmlAccessType.NONE)
@DynamicSerialize
public class ProtectedFileResponse extends AbstractUtilityResponse {
@XmlAttribute
@DynamicSerializeElement
private LocalizationLevel protectedLevel;

View file

@ -1,204 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.common.localization.msgs;
import javax.xml.bind.JAXBException;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.serialization.DynamicSerializationManager;
import com.raytheon.uf.common.serialization.DynamicSerializationManager.SerializationType;
import com.raytheon.uf.common.serialization.SerializationException;
import com.raytheon.uf.common.serialization.SerializationUtil;
/**
* Utility class for converting and constructing localization messages
*
* <pre>
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 19, 2007 chammack Initial Creation.
* Aug 22, 2008 1448 chammack Added Thrift Binary Support
*
* </pre>
*
* @author chammack
* @version 1.0
*/
public class UtilityMessageMarshaller {
/**
* Hide constructor for utility class
*/
private UtilityMessageMarshaller() {
}
/**
* Convert localization xml response to the value object
*
* @param message
* the xml message
* @return the value object
* @throws EdexException
*/
public static UtilityResponseMessage deserializeResponse(String message)
throws LocalizationException {
return (UtilityResponseMessage) deserialize(message,
UtilityResponseMessage.class);
}
/**
* Convert localization binary response to the value object
*
* @param message
* the binary message
* @return the value object
* @throws EdexException
*/
public static UtilityResponseMessage deserializeResponseBinary(
byte[] message) throws LocalizationException {
return (UtilityResponseMessage) deserializeBinary(message,
UtilityResponseMessage.class);
}
/**
* Convert localization xml request to the value object
*
* @param message
* the xml message
* @return the value object
* @throws EdexException
*/
public static UtilityRequestMessage deserializeRequest(String message)
throws LocalizationException {
return (UtilityRequestMessage) deserialize(message,
UtilityRequestMessage.class);
}
/**
* Convert localization binary message request to the value object
*
* @param message
* the binary message
* @return the value object
* @throws EdexException
*/
public static UtilityRequestMessage deserializeRequest(byte[] message)
throws LocalizationException {
return (UtilityRequestMessage) deserializeBinary(message,
UtilityRequestMessage.class);
}
/**
* Convert a request value object to XML
*
* @param message
* the value object message
* @return xml string
* @throws EdexException
*/
public static String serializeRequest(UtilityRequestMessage message)
throws LocalizationException {
return serialize(message, UtilityRequestMessage.class);
}
/**
* Convert a request value object to Binary
*
* @param message
* the value object message
* @return binary message
* @throws EdexException
*/
public static byte[] serializeRequestBinary(UtilityRequestMessage message)
throws LocalizationException {
return serializeBinary(message, UtilityRequestMessage.class);
}
/**
* Convert a response value object to XML
*
* @param message
* the value object message
* @return xml string
* @throws EdexException
*/
public static String serializeResponse(UtilityResponseMessage message)
throws LocalizationException {
return serialize(message, UtilityResponseMessage.class);
}
/**
* Convert a response value object to binary
*
* @param message
* the value object message
* @return binary message
* @throws EdexException
*/
public static byte[] serializeResponseBinary(UtilityResponseMessage message)
throws LocalizationException {
return serializeBinary(message, UtilityResponseMessage.class);
}
private static Object deserialize(String message, Class<?> c)
throws LocalizationException {
try {
return SerializationUtil.unmarshalFromXml(message);
} catch (JAXBException e) {
throw new LocalizationException("Unable to deserialize: ", e);
}
}
private static String serialize(Object o, Class<?> c)
throws LocalizationException {
try {
return SerializationUtil.marshalToXml(o);
} catch (JAXBException e) {
throw new LocalizationException("Unable to serialize: ", e);
}
}
private static Object deserializeBinary(byte[] message, Class<?> c)
throws LocalizationException {
try {
DynamicSerializationManager mgr = DynamicSerializationManager
.getManager(SerializationType.Thrift);
return mgr.deserialize(message);
} catch (SerializationException e) {
throw new LocalizationException("Unable to deserialize: ", e);
}
}
private static byte[] serializeBinary(Object o, Class<?> c)
throws LocalizationException {
try {
DynamicSerializationManager mgr = DynamicSerializationManager
.getManager(SerializationType.Thrift);
return mgr.serialize(o);
} catch (SerializationException e) {
throw new LocalizationException("Unable to serialize: ", e);
}
}
}

View file

@ -22,11 +22,6 @@ package com.raytheon.uf.common.localization.msgs;
import java.util.Arrays;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
import com.raytheon.uf.common.serialization.comm.IServerRequest;
@ -41,18 +36,17 @@ import com.raytheon.uf.common.serialization.comm.IServerRequest;
* ------------ ---------- ----------- --------------------------
* Apr 19, 2007 chammack Initial Creation.
* Aug 22, 2008 #1502 bclement Added JAXB/Serializable annotations
* Oct 01, 2013 2361 njensen Removed XML annotations
*
* </pre>
*
* @author chammack
* @version 1.0
*/
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
@DynamicSerialize
public class UtilityRequestMessage implements IServerRequest {
@XmlElement
@DynamicSerializeElement
protected AbstractUtilityCommand[] commands;

View file

@ -20,12 +20,6 @@
package com.raytheon.uf.common.localization.msgs;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import com.raytheon.uf.common.serialization.ISerializableObject;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
@ -38,18 +32,17 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
* ------------ ---------- ----------- --------------------------
* Apr 19, 2007 chammack Initial Creation.
* Aug 22, 2008 #1502 bclement Added JAXB/Serializable annotations
* Oct 01, 2013 2361 njensen Removed XML annotations
*
* </pre>
*
* @author chammack
* @version 1.0
*/
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
@DynamicSerialize
public class UtilityResponseMessage implements ISerializableObject {
@XmlElement
@DynamicSerialize
public class UtilityResponseMessage {
@DynamicSerializeElement
protected AbstractUtilityResponse[] responses;