Package com.inesm.KeyManager.model
Class Mission
java.lang.Object
com.inesm.KeyManager.model.Mission
- All Implemented Interfaces:
Resource,SharedResource,Serializable
Represents a joint usage context and sharing preferences for a set of keys.
All the getters and setters are the default ones.
Details about the meaning of each field are provided in the source code.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddeserialize(String data) Deserializes the resource from a data string generated by theResource.serialize()method.intlongGets the resource's assigned MissionUUID.getName()Gets the station resource identifier.intgetState()longbooleanbooleanisKey()Checks if the resource is aKey.booleanChecks if resource is aMission.booleanvoidUpdates the fields in the current object instance with the ones from another object.Serializes a resource into a string.voidsetBranches(String branches) voidsetDescription(String description) voidsetDistributionMode(int distributionMode) voidsetEndDate(LocalDateTime endDate) voidsetInvalidAlert(boolean invalidAlert) voidsetLocation(String location) voidsetMissionID(long missionID) voidsetMissionUUID(String uuid) voidvoidsetSharedStations(Set<String> sharedStations) voidsetStartDate(LocalDateTime startDate) voidsetState(int state) voidsetStationID(long stationID) voidsetStationName(String stationName) voidsetWaitingAlert(boolean waitingAlert) toString()
-
Field Details
-
UNDEFINED
public static final int UNDEFINED- See Also:
-
WAITING_KEYS_THRESHOLD
public static final int WAITING_KEYS_THRESHOLD- See Also:
-
STATUS_ACTIVE
public static final int STATUS_ACTIVE- See Also:
-
STATUS_INACTIVE
public static final int STATUS_INACTIVE- See Also:
-
STATUS_WAITING
public static final int STATUS_WAITING- See Also:
-
STATUS_DELETED
public static final int STATUS_DELETED- See Also:
-
-
Constructor Details
-
Mission
public Mission()
-
-
Method Details
-
patch
Updates the fields in the current object instance with the ones from another object. Will only update the fields that have been modified after the initialization.- Parameters:
upd- the object containing the fields to update the current instance with
-
getResourceID
Description copied from interface:ResourceGets the station resource identifier.- Specified by:
getResourceIDin interfaceResource- Returns:
- a string containing the resource identifier.
-
deserialize
Description copied from interface:ResourceDeserializes the resource from a data string generated by theResource.serialize()method.- Specified by:
deserializein interfaceResource- Parameters:
data- the serialized data as a string- Throws:
IOException- if an error occurred during the serialization processClassNotFoundException- if its was not possible to load the class data, or the class data was not found
-
serialize
Description copied from interface:ResourceSerializes a resource into a string.- Specified by:
serializein interfaceResource- Returns:
- the string representing the serialization of the resource.
- Throws:
IOException- if an error occurred during serialization
-
isKey
public boolean isKey()Description copied from interface:SharedResourceChecks if the resource is aKey.- Specified by:
isKeyin interfaceSharedResource- Returns:
- true if the resource is a key, false otherwise.
-
isMission
public boolean isMission()Description copied from interface:SharedResourceChecks if resource is aMission.- Specified by:
isMissionin interfaceSharedResource- Returns:
- true if the resource is a mission, false otherwise
-
toString
-
getMissionID
public long getMissionID() -
getLocation
-
setLocation
-
getBranches
-
setBranches
-
setMissionID
public void setMissionID(long missionID) -
getName
-
setName
-
getDescription
-
setDescription
-
getStationID
public long getStationID() -
setStationID
public void setStationID(long stationID) -
getStartDate
-
setStartDate
-
getEndDate
-
setEndDate
-
getState
public int getState() -
setState
public void setState(int state) -
getStationName
-
setStationName
-
getDistributionMode
public int getDistributionMode() -
setDistributionMode
public void setDistributionMode(int distributionMode) -
getMissionUUID
Description copied from interface:SharedResourceGets the resource's assigned MissionUUID.- Specified by:
getMissionUUIDin interfaceSharedResource- Returns:
- the missionUUID of the mission the resource is assigned to
-
setMissionUUID
-
isInvalidAlert
public boolean isInvalidAlert() -
setInvalidAlert
public void setInvalidAlert(boolean invalidAlert) -
isWaitingAlert
public boolean isWaitingAlert() -
setWaitingAlert
public void setWaitingAlert(boolean waitingAlert)
-